Hello,
I am having trouble with getting Xpath to work in Pentaho 4 running on windows 7.
My goal is to to Select Each F node but exclude the child F nodes. What I am trying
to get to work in Pentaho works on the below xpath tester website.
I want to be able to select the first F node and all elements except for child F nodes.
In my real XML I have child nodes that have the same element name as parent nodes.
I expect to get back f1 and f1a for the top level F. For the second F I expect to get back f2
and the final F to get back f3.
My structure looks like
Code:
Top
Next
F
f1
f1a
F
f2
F
f3
I have tried a LOT of different variations of xpath 1.0 syntax but what I want does not work.
I can only get it to pull the first element below F. In other words it will return the 'f1' element
but nothing else. However when I use the website below with the sample xml
below the website works correctly. But when I add the same thing in Pentaho I just get back 'f1'.
I expect to get back f1, f1a, and gotit for the top level F.
Pentaho step looks like this with the xml below as input
Loop Xpath: /Top
Fields: Name->MyElement, Xpath-> //Next/F/*[not(descendant::F)]
Element: Node
Result type: Single Node
Thank you for any guidance,
Oring
-------
-------
http://chris.photobooks.com/xml/default.htm (or use the xpath tester of your choice)
//Top/Next/F/*[not(descendant::F)]
Code:
<Top>
<Next>
<F>
<f1>f1</f1>
<f1a>f1a</f1a>
<F>
<f2>f2</f2>
<F>
<f3>f3</f3>
</F>
</F>
<gotit>gotit</gotit>
</F>
</Next>
</Top>