PDA

View Full Version : Pentaho escaping characters



solid_rock
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>
<cases-doc>
<marginal>
<marginal-yea>{parteactora_pub}</marginal-yea>
<marginal-num/>
</marginal>
</cases-doc>
</docs>;
}

And this is what I get:

<docs>
&lt;cases-doc&gt;
&lt;marginal&gt;
&lt;marginal-yea&gt;Yonhy Lescano Ancieta&lt;/marginal-yea&gt;
&lt;marginal-num/&gt;
&lt;/marginal&gt;
&lt;/cases-doc&gt;
</docs>

Any help will be appreciated, regards