Basic XPATH syntax
Monday, March 29, 2010
2:16 PM
Basic XPATH syntax
First use: locating elements in some source document.  
location: where something is within the source document.
foo/bar matches an element named bar inside the content of an element named foo, without any intervening containing elements.
/foo/bar matches an element named bar inside the content of an element named foo, starting at top level of the document.
foo//bar matches an element named bar inside the content of an element named foo, at any level of nesting.
foo/@bar matches the attributes bar of tags named foo.
* matches any tag inside the current context.
..: matches one level up (parent). foo/bar/.. matches any foo containing a bar.
.: matches current level: foo/bar/. is the same as foo/bar.
Pasted from <[link]> 