View Full Version : Pentaho escaping characters

05-23-2013, 12:07 PM
Hi everybody, I'm totally new at Pentaho and I'm having some problems with my first project. Basically, I have an xml input and I want to generate an xml output, so I've created a transformation and added a "Get data from XML" component, a "Modified Java Script Value", and a "XML Output"; the input component just reads the XML file, in the Java Script step I created a variable to hold the xml content of the file and also I read some values on it (the function's code is at the bottom) and the XML Output just generates the file. The problem is that the generated xml escapes all the "<" and ">" symbols; I've tried adding a "Replace in String" component and specifying the symbols to replace (&lt; by < and &gt; by >) but nothing happened, does anybody have some tip?
This is the javascript code:

var xml;
if (xml==null) {
xml = new XML();
var xml =<docs>

And this is what I get:

&lt;marginal-yea&gt;Yonhy Lescano Ancieta&lt;/marginal-yea&gt;

Any help will be appreciated, regards