*
The moose likes XML and Related Technologies and the fly likes to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not " Watch "to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not " New topic
Author

to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
I want to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not know how to syntax the .xsl file (java is ok)?
In this case if one file is eg 234bytes the other must be 234bytes?
I must use for-each or apply-templates or both or any?
eg. an xml:

[code] <?xml version="1.0"?>
<plants xmlns = "x-schema:your-first-schema.xml">
<plant id="25">
<name>Carnation</name>
<scientificName>Dianthus</scientificName>
<onHand>4000</onHand>
<color>Red</color>
</plant>
<plant id="65">
<name>Lily-Of-The-Valley</name>
<scientificName>Convallaria</scientificName>
<onHand>250</onHand>
<color>White</color>
</plant>
<plant id="115">
<name>Violet</name>
<scientificName>Viola</scientificName>
<onHand>900</onHand>
<color>Purple</color>
</plant>
<plant id="1195">
<name>Violet2</name>
<scientificName>Viola2</scientificName>
<onHand>90</onHand>
<color>Purple2</color>
</plant>
</plants>
[/code]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You could just use the XSLT identity template. But even that doesn't guarantee that the output file will be byte-for-byte identical to the input file; for example the process might have normalized an unnormalized attribute value, or it might have chosen to use double quotes around attribute values where the input had single quotes.

So why not just use ordinary Java code which ignores the XML aspect of the file entirely and just copies the bytes from the input to the output?
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
How about using the 'cp' (UNIX) or 'copy' (MS-DOS) programs?

Simply,

...\cp file1.txt file2.txt

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
the hint here was a <xsl:copy> usage for practice, can you tell how may used event not exact copy??
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
I used success the:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to EXACT Dublicate an xml file[xml->xml] via Java TransformerFactory classes and XSTL well I do not
 
Similar Threads
I tried debug failing: trying to incle xml file contents to db table
How to remove dublicate elements from List
I tried find the BUG in this SAX PARSER But NO-RESULT:
I do not know in which part of SAX Class
Random number without dublicate