Wednesday, 25 February 2015

Pentaho PDI - XPath syntax for XML Join step



I am trying to join xml code with Pentaho PDI in a transformation with a "Add XML" step, which add some fields with a "Root XML Element" set as "Node" (like below) and a "XML Join" step.


I want to insert some fields with the same data into each and every "Node".



<Rootnode>
<Node>
<Node>
<Node>
</Rootnode>


The problem is that, no matter what XPath expression I try, the fields I want to insert are only inserted in the first node. Expressions like "RootNode/Node" or "//Node" are not working.


This is the result I get:



<RootNode>
<Node>
<inserted field>
<Node>
<Node>
</RootNode>


This is what I want to get:



<RootNode>
<Node>
<inserted field>
<Node>
<inserted field>
<Node>
<inserted field>
</RootNode>


Questions: can the XML-join step only join code into one explicitly specified node or is there a XPath-expression I can use in the XML-join step´s XPath Statement input to insert the code into all nodes of my choice?


(I dont think a complex join with a comparion field is appropriate because I dont have anything to compare with.)


No comments:

Post a Comment