XSLT: how to deep copy (including DOCTYPE, encoding, etc.)

I've written the following stylesheet to copy an existing XML. during testing, i noticed that the DOCTYPE was not copied at all and the XML encoding defaultet to UTF-8 (though the original XML has ISO-8859-1). to fix this, i have to set the encoding and doctype-system hard coded:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- adjust doctype-system to generate a different DOCTYPE SYSTEM value: -->
    <xsl:output method="xml" encoding="ISO-8859-1" doctype-system="mine.dtd"/>
    <!-- copy nodes: -->
    <xsl:template match="node()|@*" >
       <xsl:copy>
            <xsl:apply-templates select="node()|@*" />
       </xsl:copy>
    </xsl:template>
</xsl:stylesheet>but this results in a specialized copy-XSL. is there a generalized way to copy a XML with all content (including <! and <? tags, etc.)? (of course,

The encoding of an XML document is not a significant feature. If you look at the XML specification you'll see that it defines an XML document as a sequence of Unicode characters. How you encode that in bytes is not part of the specification.
That means that if you take a document and make one version of it encoded in UTF-8 and another version encoded in ISO-8859-1, those are both the same XML document.
You'll notice that XSLT doesn't give you a way to find the encoding of any of its input documents, because it is irrelevant to XML. So if you want to treat the encoding as a significant feature, then that's nothing to do with XML. You'll have to find some other way to deal with it.

Similar Messages

  • I would like to "get off the cloud".  How do I copy all my contacts, etc from where they are to "on my Mac"?

    I would like to "get off the cloud".  How do I copy all my contacts, etc from where they are on the cloud to "on my Mac"?

    Export the information to your Desktop. Stop syncing in iCloud, which should give you the 'On My Mac' option. Then import the information.

  • How to deep copy a component configuration?

    Hi Experts,
    I want to deep copy a component configuration named EHHSS_RAS_OIF.
    But following was the error shown.
    Can you please help/guide to do the same.
    Thanks in advance.
    Sanket.

    Hi Sanket,
    I think you might be copying the config in Unit test client but not in Development client.
    Thanks
    KH

  • How does deep copy apply to arrays?

    I have a service object that has a method that returns an array of
    objects. The return type for the method is defined with the copy option.
    I found documentation that states that the copy option creates a deep
    copy of the return variable on the partition that called the method.
    My question is: If the return type for the method is an array of
    objects, will the copy option create copies of all objects/elements in
    the array?
    We wish to eliminate any object references to the service object's
    partition. Any insight would be greatly appreciated.
    Thanks in advance,
    Van Vuong
    Phone: 972.985.5289
    Pager: 972.320.2232
    VoiceNow Pager: 972.330.0822
    E-mail: [email protected]
    PAGE NET

    Copy option always copies deep. Remember, also if you pass the array
    accross partitions, whether you specify copy or not, it is going to copy
    and copy deep.
    In an array, I am not sure if have the problem, because unless the array
    in-turn holds a huge tree, the array object may be wide, but not deep.
    Some thing to think about??
    Venkat

  • How do I copy effects (crop, movement, etc) from one clip to another?

    I have adjusted one clip of footage  in my "timeline" to be a certain size, etc and I want to apply those same effects to a bunch of clips in the timeline. How do I do that? One use to just copy the clip and paste properties but I can't find how to do that in FCPX.
    Thanks for any help

    Thot I'd pop back over here after happening upon the Cmd-Opt-C keystroke which is defined in FCPX Help as "copy selected effects".
    This implies that instead of the old way (Copy with Cmd-C, then select attributes with the Paste Attributes (Opt-V) command), one makes the effects choices up front -- using cmd-opt-C, and then pastes them using the Cmd-Opt-V keystroke.
    However, I see no difference between using Cmd-C and using Cmd-Opt-C.  The Cmd-Opt-V keystroke still ends up pasting all attributes/effects.
    Guess I'll go bring this to their attention.

  • How to restore Files including Photos, Contacts.etc after wiping out in the absence of performing any back up ?

    I Actually, I have wiped My Blackberry torch 9800 out although I Have Not done any Back up . So, Is there any possibility to recover My files Including Photos, Videos, Contacts ,..Etc? Because I Really need those Files for Student examination Purposes ?! If you could deliver If anything can be done so,,, your responses are appreciated,,,, Waiting for your response,,,,,

    No backup at all?  Were you not even running protect?  How about sync'ing with a computer or with the cloud?
    If you really don't have any form of backup and did not sync with Outlook, Google, or something, nor sync music and pictures with a computer, then whatever you had on device memory is gone.  If you were using a media card then you may have that, unless it got wiped in the process.
    - Ira

  • How is a distribution list created in 'Mail'?  Everyone I need to include is already in my contact list so how do I copy them into a single list which I've created?

    How is a distribution list created in 'Mail'?  Every address I need to include is already in my 'Contacts', so how do I copy them into my single list?

    In Contacts, add a new group, and then add all the desired recipients to the group.
    Contacts – Create Mail Group

  • How do i copy a photoshop folder from my Imac including keywords to my Macbook computer with photoshop on it to take it on a trip

    how do i copy a photoshop folder from my Imac including keywords to my Macbook computer with photoshop on it to take it on a trip

    I do not use a mac. If you are referring to Image files and metadata. Metadata may be in the image file or in sidecar files in the the same folder. It may depend on how you have set some of Adobe setting.  Bridge may have some metadata is its cache and users system data areas. ACR may store it information in an ACR database rather then sidecar files.  If you use Lightroom metadata is most likely in its library databases.
    Photoshop has many folders.   Users images are in your user id folders of perhaps in lightroom's library not in  Adobe  Photoshop folders. I do not use Lightroom.   What exactly are you referring to when you wrote "a Photoshop Folder"?

  • How do I include DOCTYPE in my XMLfile using Oracle XMLDOM or XMLParser Package

    I am creating a XML file using Oracle XMLDOM and XMLPARSER package. But I am not able to include
    <!DOCTYPE XYZ SYSTEM ABC.DTD!>
    in the second line of my XML file.
    How do I include DOCTYPE in my xmlfile using Oracle xmldom or xmlparser package?

    XML Parser for PL/SQL 9.0.0.0A (Beta) release has the setDoctype() procedure that takes an xmldom.DOMDocument and the string for the System and Public ID's to set.

  • How can I copy mp3 files from my Itunes library to an SD card for use in a non-apple phone?

    How can I copy mp3 files from my Itunes library to an SD card for use in a non-apple phone?  I can physically copy the tunes as mp3's but the phone does not seem to be able to play all of them.   Do I need to copy an entire album or can I just pick & choose individual songs?   The phone is question is an LG running who knows what for an operating system.

    AAC is Advanced Audio Coding.  Basically it's a format that sounds better than MP3 but doesn't take up as much space as a lossless format (like you'd have on a CD).  More than likely you've had that encoding turned on when you ripped your music into itunes (it's the default encoder).  Therefore your LG phone won't play them.
    You need to turn off the AAC format by going to the iTunes menu, Preferences, General (at the top), then clicking the "Import Preferences" button.  Change the AAC Encoder to MP3 Encoder.  After that you'll have to make MP3 copies of your songs by right clicking them and selecting "Create MP3 Version."  You'll get a copy of the song that should transfer to your SD card and have MP3 encoding.  Hopefully your phone will play that.

  • How to I copy photos from my ipod classic back onto my pc?

    How to I copy photos from my ipod classic back onto my pc? My hardrive recently crashed and the photos on my ipod are the only copies I have! The photos were synced onto th ipod originally - not saved or copied as file transfer.

    See Recover your iTunes library from your iPod or iOS device. I'm not sure which of the recovery tools can do photos offhand, but unless you chose the option to include full res. originals when you loaded the device then what they extract will be fairly low res. If you did opt for full res. then they should be visible on the iPod's drive when viewed in disk mode.
    tt2

  • How do I copy photos from my Mac to my iPad without deleting the ones that are there?

    I understand how to sync photos from my iPhoto library to my iPad. I want to copy photos from my Mac to the iPad without syncing, because syncing deletes everything on the iPad that isn't included in my sync selections. In addition,I have several iPhoto libraries and want to copy photos from each of them to the iPad. A further issue is that apparently photos can be synced from only one computer to the iPad -- how would I copy photos from a different computer? (What happens when I buy a new Mac?) I am extremely experienced with Mac, iPhoto/Aperture, iPad, etc. A year or two ago I transferred 1000 photos to the iPad but I don't remember how, and it was probably done with my previous Mac. Now I just want to add some recent photos without deleting the ones that are there. Bottom line: is there a way to add photos to an iPad without syncing and losing what's there?

    You can still sync the photos and keep the photos that are already on the device. You have to include all of the albums or events in the pictures folder that you sync from. If you are using iPhoto, select that in the Sync Photos from drop down menu and then select all of the albums or events that you want to sync. Make sure to check Selected Albums, events, faces and automatically include (no events). Using that option will allow you to choose exactly which albums and events to sync.
    You have to remember that all photos must be included in every sync so you cannot sync photos from iPhoto today and then try to sync photos from another folder tomorrow, or you will erase all of the photos that were synced from iPhoto. You need to maintain one main Photos syncing folder for the photos that you want to transfer to the iPad. You can have subfolders within that one main folder and you can selectively sync those subfolders. You just have to place all of the photos that you want to sync into one main iPad syncing photos folder.
    There are WiFi transfer apps that allow you to transfer photos to the iPad without having to sync with iTunes. I use this one. This app (and others like it) will allow you to use multiple computers to transfer photos.
    Wireless Transfer App Easily send photos to iPhone/iPad ...

  • How can I copy cell formatting from one range to another?

    How can I copy cell formatting from one range to another, including text fonts, colours, borders, etc., so that, for example, I can reuse a formatted reconciliation table again in different parts of a sheet?

    Hi George,
    Wayne found the Spinning Beachball of Death, and you will find it too.
    Numbers is not good at handling large datasets. Might I suggest that you group your data into smaller sets (each month, perhaps?) and save each group in a separate Numbers document. Numbers will not link between documents, but you could have a summary Table within each document. Then comes the "clunky" bit of copying all those summary tables into a master document where you do the final processing of the data.
    Regards,
    Ian.

  • I need to copy audio files and projects from logic to an external hard as my MBPis nearly full and my external hard drive has packed up with all my files on it, any suggestions on how do I copy 200GB from my MBP to a new external HD

    I Use logic and back my audio file and projects on an external HD ,this has now packed up . I have all the files in the MBP , but need to copy them to a new external HD, I have only 10GB left on my machine , how do I copy 200GB from my machine to a new External HD.
    any helpful full advice would be appreciated.
    angus

    Yes, just drag and drop them into the drive..
    How long will it take? Hard to say without knowing the type and speed of the drives in question.. and even then it's hard to estimate... but does time really matter?
    The fact you only have 10 Gigs left will/may slow the process down but it wont/shouldn't stop it...
    If needed.. just drag and drop some of the files at a time.. not all of them.
    Remember that copying files doesn't delete them from the original drive... You will still need to delete them yourself after they are copied over and empty the trash....
    However....
    When you saved these projects in Logic (Pro X?) did you save them using the include audio files option?
    If not, then when you move the audio files used in these projects... Logic will not know where they are to reload them........ and that will cause you issues.
    So.. if you didn't...
    I would use this method instead...
    Logic Pro X: Move, copy, and convert audio files

  • How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    If the drive has failed the only way to get any data off it is to send it to a Data Recovery company. Which is very expensive and no guaranty they will be able to retrieve any data.
    That is why Apple has included a system to backup your Mac on a regular basis, Time Machine. Also there are other Apps to do basically the same thing by Cloning your internal drive to an external drive. Carbon Copy Cloner and SuperDuper. Along with using Disk Utility to Image the internal drive to an external drive.
    Sorry to tell you but if the drive has really failed your Data is gone unless you pay a large sum of money to one of the Data recovery companies.

Maybe you are looking for

  • Connecting aqos 32 inch tv

    I have conneted both a 19-inch monitor and 32 inch tv. I find when I siwtch the reolution of one, it affects that of the other. Turn the 19 inch monitor to a small resolution gives me more possibilities for the Aqous TV. Assume that the G5 drives up

  • Help, 655 Max

    I recently upgraded my system to a P4 3.06 GHz, 1 gig pc 2700 DDR SDRAM. I use OS windows XP. All the components are different than my first computer. The only similarities was the brand of the motherboard. MSI... The problem I have, my computer acts

  • I've never updated my OS X 10.5.8. What can/should I update to and how do I go about it?

    I've never updated my OS X 10.5.8. What can I update to and how do I go about it?

  • S_ALR_87012179 question

    Hello All, In transaction S_ALR_87012179 under the dynamic selection criteria, the credit control area fields do not seem to be turned on. Whenever I input and data and try to search it seems that the fields under that selction are not activated. Doe

  • Autodiscover pop up in outlook

    Hello I was wondering if someone could help me with an issue that I am having with an Auto-discover pop up. We have had this issue since fixing an issue with out of office not working. What we ended up doing is putting an A record entry in our dns ho