>Hi, I'm trying to get some XPath to work with respect to a navigation tree.
>
><?xml version="1.0" encoding="utf-8" ?>
><tree>
><node objectid="3456" title="Informationa">
><node objectid="2134" title="Contact" />
><node objectid="5656" title="Top 1.2" />
><node objectid="5672" title="Top 1.3" />
><node objectid="123" title="Top 1.4" />
><node objectid="8357" title="Top 1.5" />
></node>
><node objectid="9834" title="Banks" circuit="banks" />
><node objectid="2245" title="Corporates" circuit="corporates">
><node objectid="45688" title="Top 3.1" />
><node objectid="9567" title="Top 3.2" />
><node objectid="4633" title="Top 3.3" />
></node>
><node objectid="1554" title="Managers" />
><node objectid="6734" title="Library" />
></tree>
>
>I can use Xpath to return all the child nodes within a node using
>//[EMAIL PROTECTED]"3"]
Couple of things here, Tony.
1) You can "chain" xpaths together.
2) Learn all of the Xpaths Axes (sp?)!
In this case, you could grab the objectID of the node element with an objectID of 2134 like this:
//[EMAIL PROTECTED]/parent::node
Notice the reference to the exact node, and then a reference to the "parent" axis, asking for a "node" element.
Hope this helps.
----------------------------------
Alex Sherwood
PHS Collection Agency
THE COLLECTORS
P: 813-283-4579
F: 301.664.6834
W: www.phs-net.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]