Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Generating XML fragment to DOM node using XSL

Reply
Thread Tools

Generating XML fragment to DOM node using XSL

 
 
Steve Dussinger
Guest
Posts: n/a
 
      12-11-2003
Hi All:

I am attempting to use an XSL stylesheet to take data from an existing
DOM document, and place it into a different existing DOM document.

The problem I'm having is that I get the following exception from
Xalan-J (version 2.5.2), because I am not generating a single root
node from my stylesheet:

"Can't have more than one root on a DOM!"

Now I understand that I can't create more than one root node on a DOM
document, but since I'm generating these nodes into an already
existing document, I assumed that this would not be an issue. I can
generate a single rot node as part of my transform, and all works
fine, but the resulting data as placed into my destination document is
screwed due to the addition of a new node.

Is there some switch setting or something that I need to use to make
this work? I'm fervently hoping that this is not something that "just
can't be done using XSLT", and that I've just missed something in the
docs...

Any help greatly appreciated...

Thanx,
Steve Dussinger
 
Reply With Quote
 
 
 
 
GIMME
Guest
Posts: n/a
 
      12-15-2003
If you're interested in a JDOM solution, let me know.

There's no point of my cooking up a solution if it is of no interest to you.
 
Reply With Quote
 
 
 
 
Steve Dussinger
Guest
Posts: n/a
 
      12-15-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> If you're interested in a JDOM solution, let me know.
>
> There's no point of my cooking up a solution if it is of no interest to you.


Thanx for the interest, but I *really* need to be able to do this with XSLT...

Thanx anyway.

--Steve
 
Reply With Quote
 
GIMME
Guest
Posts: n/a
 
      12-16-2003
I'm puzzled by what you mean when you say you need use XSLT.

Do you mean that you need a command line solution and that
you can't write a JAVA program to do the work?

XSLT transforms are easy with JDOM.

With JDOM you can go back and forth between JDOM
Documents and W3C Documents with one method call.

Go to http://www.jdom.org/docs/apidocs/index.html and look
at DOMBuilder and DOMOutputter. Look at JDOMResult if you
want to see how to do a transform.

If you want an example where I :

1. read an xslt file,
2. read an xml
3. read an xml
4. Do a transform on one and two.
5. Combine the result with 3.
6. Return a single org.w3c.dom.Document

let me know. That's what you wanted. Right?


(E-Mail Removed) (Steve Dussinger) wrote in message news:<(E-Mail Removed). com>...
> (E-Mail Removed) (GIMME) wrote in message news:<(E-Mail Removed). com>...
> > If you're interested in a JDOM solution, let me know.
> >
> > There's no point of my cooking up a solution if it is of no interest to you.

>
> Thanx for the interest, but I *really* need to be able to do this with XSLT...
>
> Thanx anyway.
>
> --Steve

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding an XML fragment as a child node in a pre-existing Element tree Rajarshi Python 1 02-11-2007 07:18 PM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
XSL HOWDOI use attribute of current node to select a different node? CB XML 1 10-02-2003 02:37 PM
[HELP] Create a DOM using a node from another node yio@free.fr Java 0 07-16-2003 12:30 PM



Advertisments