Hi Dave,
"/node1" in XPath means to search the node (node1) from the root.
"self::node1" in XPath means to search the node (node1) from the current
node.
If the current node is the root, there is no different between these two
XPath.
However, if the current node is not the root of XML, the result executed by
these XPath will be different.
For example:
/
-Node1
-Node2
-Node3
-Node4
-Node5
If the current node is / (root), you can get the node(Node1) by both
"/Node1" and "self::Node1".
But if the current node is the node(Node4), the XPath"/Node1" will work,
but the "self::node1" will return null. Additionally, if you want to a get
the node(Node5), you should use "self::node5" or "/node3/node4/node5". But
"/node5" will return NULL.
"self::node5" is a relative location path and "/node3/node4/node5" is an
absolute location path.
>1) should we start with /node1 or self::/node1?
I would like to start with "/node1", because it is the absolute location
path.
>2) if they click on the root should we use "self::" or "/"?
I think "/" should be the root.
http://www.w3schools.com/xpath/xpath_axes.asp
[XPath Axes]
Hope this helps.
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.