I read some Xpath code, some begin with "/xxxx", some begin with "//xxxx". What're their differences? Do they have different behavior just in "Select" or different also in other behaviors?
I didn't find corresponding explanations on this site, any hints?
Thanks.
Beginning an XPath with one slash will retrieve the root of the document, so that
/xxxx
will match only the<xxxx>
element that is the root of the XML.Example:
Whereas
//xxxx
will match all<xxxx>
elements anywhere in the document.Example: