George George

George George

  • NA
  • 778
  • 0

how to use XPath to parse the XML file?

Jan 5 2009 9:19 AM

Hello everyone,

Suppose I have the following XML file, I want to use XPath query based technologies to iterate all attributes for all rules nodes and all attributes for each sub rule nodes (under each rules node).

Could anyone provide some pseudo code please? I know how to query rules and related attribute but do not know how to loop inside embed node rule under each rules node.

[Code]
<Abc>
    <rules name="USA">
    <rule foo="123" goo="345"/>
    </rules>
    <rules name="CAN">
    <rule foo="321" goo="543"/>
    <rule foo="321" goo="234"/>
    </rules>
</Abc>
[/Code]

thanks in advance,
George


Answers (2)