[jdom-interest] Question regarding XML transformation!

Salim Hamid hamid at us.ibm.com
Tue May 18 10:17:27 PDT 2004


We've recently acquired Beta 10 release of JDOM and are interested in the 
new transformation classes.  Do they support transforming an XML doc using 
an XSL file that I provide?  I have the following code but I get the 
exception "java.lang.IllegalStateException: Root element not set " when I 
attempt to do anything with the transformed document:

       XSLTransformer transformer = new XSLTransformer(xslFileName);
       Document targetDoc = transformer.transform(sourceDoc);

       System.out.println(targetDoc);  // This line throws the exception 
indicating that the transformation did not occur correctly

The XML doc is transformed fine using the XMLTransformer class provided by 
IBM WebSphere.  Unfortunately, the WebSphere class only deals with files-- 
something that we don't want due to I/O processing.  We want to transform 
XML strings instead of files.  Am I not understanding something about the 
JDOM transformation classes or are there future plans to support what we 
want?

A reply to this note would be greatly appreciated.

Regards,

Salim Hamid
IBM Software Group --  Digital Media Development
301-803-1247   T/L 262-1247
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040518/91e69336/attachment.htm


More information about the jdom-interest mailing list