[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Merging two documents
At 99/09/20 19:02 -0700, Terris wrote:
Do you think using document() is superior to concatenating the two documents first? Absolutely! For example, the following XML document would be created: In your specific example above there would probably be no problems, but what if both documents had attributes declared as ID attributes? What if there were an element in each document that happened by coincidence to have the same unique identifier? Using document() allows you to still access both documents, but access the unique identifiers found in both documents without the risk of collision. My examples earlier showed how using <xsl:for-each> with the document() function allows you to access the ID space within each document independently. If both documents, each with the same ID in use, were merged into one, it couldn't be validated (because of duplicate IDs) and the id() function of XSLT would at best only find one and at worst report the duplicate ID as an error and refuse to execute. Of course this isn't a problem if you aren't using IDs, but I assumed you were asking about the general case. I hope this helps. ............ Ken
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|