<br><font size=2 face="sans-serif">Actually, in this case I build the document
programmatically using JDOM and I know the Document object is built correctly
since I can recreate the XML string back from it. Unfortunately,
JDOM's XSLTransformer class doesn't like something about this same Document
object that I build using the JDOM classes and methods. So, is there
something extra that I need to do than the code below?</font>
<br>
<br><font size=2><tt> XSLTransformer
transformer = new XSLTransformer(xslFileName);<br>
Document targetDoc = transformer.transform(sourceDoc);<br>
</tt></font>
<br><font size=2 face="sans-serif"><br>
Regards,<br>
<br>
Salim Hamid<br>
IBM Software Group -- Digital Media Development<br>
301-803-1247 T/L 262-1247<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Jason Hunter <jhunter@xquery.com></b></font>
<br><font size=1 face="sans-serif">Sent by: jdom-interest-admin@jdom.org</font>
<p><font size=1 face="sans-serif">05/18/2004 01:44 PM</font>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To:
Salim Hamid/Gaithersburg/IBM@IBMUS</font>
<br><font size=1 face="sans-serif"> cc:
jdom-interest@jdom.org</font>
<br><font size=1 face="sans-serif"> Subject:
Re: [jdom-interest] Question regarding
XML transformation!</font></table>
<br>
<br>
<br><font size=2><tt>Sounds like the result of your transform was not a
document but just one <br>
or more nodes. There are other methods on XSLTransformer to handle
this <br>
situation. And you can transform strings instead of files by just
<br>
building from a string. It's shown in the FAQ.<br>
<br>
-jh-<br>
<br>
Salim Hamid wrote:<br>
<br>
> <br>
> We've recently acquired Beta 10 release of JDOM and are interested
in <br>
> the new transformation classes. Do they support transforming
an XML doc <br>
> using an XSL file that I provide? I have the following code
but I get <br>
> the exception "*java.lang.IllegalStateException: Root element
not set* " <br>
> when I attempt to do anything with the transformed document:<br>
> <br>
> XSLTransformer transformer = new XSLTransformer(xslFileName);<br>
> Document targetDoc = transformer.transform(sourceDoc);<br>
> <br>
> System.out.println(targetDoc); *//
This line throws the <br>
> exception indicating that the transformation did not occur correctly*<br>
> <br>
> The XML doc is transformed fine using the XMLTransformer class provided
<br>
> by IBM WebSphere. Unfortunately, the WebSphere class only deals
with <br>
> files-- something that we don't want due to I/O processing. We
want to <br>
> transform XML strings instead of files. Am I not understanding
<br>
> something about the JDOM transformation classes or are there future
<br>
> plans to support what we want?<br>
> <br>
> A reply to this note would be greatly appreciated.<br>
> <br>
> Regards,<br>
> <br>
> Salim Hamid<br>
> IBM Software Group -- Digital Media Development<br>
> 301-803-1247 T/L 262-1247<br>
_______________________________________________<br>
To control your jdom-interest membership:<br>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com<br>
</tt></font>
<br>