Subject: RE: Re: [xsl] Generating XML fragment to DOM node using XSL From: cknell@xxxxxxxxxx Date: Tue, 16 Dec 2003 18:08:08 -0500 |
XSLT transforms one tree of nodes into another. That means that it doesn't do anything to the original document, ever. If you want to change the original document, you must serialize the output to file system, giving the new document the same name and path as the original. 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 -- Charles Knell cknell@xxxxxxxxxx - email -----Original Message----- From: Steve Dussinger <sdussing@xxxxxxxxx> Sent: Tue, 16 Dec 2003 14:05:50 -0800 To: "xsl-list@xxxxxxxxxxxxxxxxxxxxxx" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: [xsl] Generating XML fragment to DOM node using XSL On 12/16/03 1:44 PM, "Gupta, Raman K [CI]" <raman.k.gupta@xxxxxxxxxxxxx> wrote: >> I want the root node to be any currently existing element in >> my DOM tree. I can control the choice of which node is my >> parent in the destination tree, but if I try to put more than >> one node under that parent element, I get this error, even >> though I don't think the error is correct. > > Steve, > > Have you checked http://www.dpawson.co.uk/xsl/sect2/N2602.html, > specifically question 4 (merging two documents)? > > Cheers, > Raman > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > I hadn't seen that one, but it doesn't do what I'm after, either. My problem is that I already have a DOM document that I want to insert into. I'm not combining documents to make a whole new document. It seems like all of the existing examples use this technique to combine documents, rather than add a new nodes to an existing document, like I need to do... I'm starting to get the sinking feeling that what I need to do isn't possible using XSLT alone, and I'm going to need to come up with some hack the post-processes a new DOM tree and copies the results into the tree I want. It's not the solution I was hoping for, but nothing better seems to be presenting itself... Thanx, Steve XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Generating XML fragment t, Wendell Piez | Thread | Re: [xsl] Generating XML fragment t, Steve Dussinger |
Re: [xsl] Complex (i think) xpath m, Kevin Jones | Date | Re: [xsl] Generating XML fragment t, Wendell Piez |
Month |