XMLUtils cannot be resolved

Highlighted
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
Highlighted
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

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog