[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Generating XML fragment to DOM node using XSL

Subject: Re: Generating XML fragment to DOM node using XSL
From: Stan Devitt <jsdevitt@xxxxxxxxxxxxxx>
Date: Tue, 16 Dec 2003 18:50:29 -0500
xml fragment append

Precisely. As a specific example, the following code fragment would append the
second document as the last node of the root element of the first document. (The step that is easy to miss here is the importNode.)
...
Element root = doc1.getDocumentElement(); Element root2 = doc2.getDocumentElement();
Element copy2 = (Element) doc1.importNode( root2 , true );
root.appendChild(copy2);


While it is also easy to apply an XSLT transform  directly to doc1
to transform doc1 into a new "Document" you would still need some
way of having XSLT's document( ) (or similar function)
refer to the already parsed document,  doc2.  So far the only suggestion for
how to do this has been to serialize and save doc2.

Stan Devitt


cknell@xxxxxxxxxx wrote:


[...]
It seems to me that what you are really after is DOM programming. You want to get a set of nodes from one document and append them to some element in a second document. For DOM programming, you may want to look at:
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/java-binding.html
and
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html





XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.