One Star

XMLUtils cannot be resolved

Hi,
I am using Talend Open studio 5.6.1. While running below Java code in a tJava component
System.out.println(XMLUtils.DOMToString((Document) globalMap.get("req.payload")));
I get the error message : "XMLUtils cannot be resolved"
I am using java version "1.7.0_67". Which jar file do I need to load using tLibraryLoad component.
Thanks,
Alok
1 REPLY
Community Manager

Re: XMLUtils cannot be resolved

Hi 
You need to load axis.jar with tLibraryLoad before using its API. About API, see 
https://axis.apache.org/axis/java/apiDocs/org/apache/axis/utils/XMLUtils.html
and you should write the complete package name. 
System.out.println(org.apache.axis.utils.XMLUtils.DOMToString((Document) globalMap.get("req.payload")));

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business