0 Replies Latest reply on Apr 2, 2007 3:34 PM by JabbyPandaUA

    How to determine in XML structure that node of interest is at root level?

    JabbyPandaUA Level 3
      I have the following XML:

      <Folder id="1"/>
      <Folder id="2">
      <Station id="1" />
      <Station id="7"/>
      <Folder id="5" />

      How to determine that XML node, say <Folder id="5"> is located at rool level of XML structure?

      Pretend that variable 'myNode' contains a reference to <Folder id="5"> XML node.

      The following boolean check: myNode.parent()name.toString() != "root" does not work for me and it seems to be rigid and insecure.