我有一个XML
在下面提到的格式。我在pentaho中使用Get XML来解析这个问题。但我无法获得正确的路径来获取所有的值。 我想要'自定义属性'的所有值。如何提取pentaho中的XML节点值和循环节点?
它只给我只有'性'的第一个属性.i.e的值。 任何人都可以请帮助我如何获得其他定制属性的值。
我已经给出了 'LoopXpath' 为设置: - /names/name
按下后 '获取领域' 在领域选项卡,。我会自动在Fields选项卡中获取自定义属性xpath,如下所述: - 它只给出'sex'的值。
Name |Xpath |Element | ResultType |Type
----------------------------------------------------------------------------------------------
custom-attributes |custom-attributes/custom-attribute |Node |Value of |String
<names>
<name>
<firstname>ABCDEH</firstname>
<lastname>JKLAM</lastname>
<custom-attributes>
<custom-attribute attribute-id="sex">male</custom-attribute>
<custom-attribute attribute-id="height">169</custom-attribute>
<custom-attribute attribute-id="weight">78</custom-attribute>
<custom-attribute attribute-id="dateofbirth">09/09/1990</custom-attribute>
<custom-attribute attribute-id="occupation">engineer</custom-attribute>
</custom-attributes>
</name>
</names>
最后,我想单行类似下面: -
firstname lastname sex height weight dateofbirth occupation
ABCDEH JKLAM male 160 78 09/09/1990 engineer
任何人都可以请帮我在
XPath本身是正确的。显示你如何使用它。 – Tomalak 2015-02-05 16:13:55