JAXP getDocumentElement() not working in Tomcat 4.1.18 ?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ethan_allen
Posted On:   Wednesday, October 22, 2003 07:58 AM

I am using JAXP from the JDK 1.4.2 release and Tomcat 4.1.18. I have no problem with most XML/XSL manipulations, but when I try to use Document.getDocumentElement() in Java classes running inside Tomcat I get a strange outcome. I build and change a DOM in my Java classes from an XML String passed in. I use getDocumentElement() to return a DOM in String form to return to a servlet. My root node is in the XML, by the way. I have been returning (doc.getDocumentElement()).toString() and getting a String containing all the DOM elements without any problem when I built and tested these classes in Eclipse. When I run the same classes in Tomcat 4.1.18, the String produced by (doc.getDocumentElement()).toString() is always [rft   More>>

I am using JAXP from the JDK 1.4.2 release and Tomcat 4.1.18. I have no problem with most XML/XSL manipulations, but when I try to use Document.getDocumentElement() in Java classes running inside Tomcat I get a strange outcome.


I build and change a DOM in my Java classes from an XML String passed in. I use getDocumentElement() to return a DOM in String form to return to a servlet. My root node is in the XML, by the way. I have been returning (doc.getDocumentElement()).toString() and getting a String containing all the DOM elements without any problem when I built and tested these classes in Eclipse.



When I run the same classes in Tomcat 4.1.18, the String produced by (doc.getDocumentElement()).toString() is always
[rft: null] ...



I am confused by some of the stuff I see out on the Web. As far as I can tell, Tomcat 4.1.x should work with the JAXP stuff ... what am I doing wrong ? Is there a better way to get a String representation of DOM contents ?



thanks ...

   <<Less
About | Sitemap | Contact