Sitecore XPath allows to perform lookups using the following syntax:
Absolute path definition, i.e. /sitecore/content/Home/item_01/item_list_02 Below are some syntax samples:
"/sitecore/content/Home" Returns all items that are children to home.
"/content/Home" Returns all items that are children to home (/sitecore is omittable)
"/sitecore/content/home|/sitecore/system" Yields children of home and system items.
"query:/sitecore/content/home/*" Returns all items that are children to home.
"query:/sitecore/content/home//*" Returns all items that have home as ancestor.
"query:/sitecore/content/home//*[@@templatename='Document']" Returns all items that have home as ancestor and have Document as template name. (@@ is not a typo).
"query:/sitecore/content/home//*[@MyField='MyValue']" Returns all items that have home as ancestor and have a field named "MyField" with the value "MyValue".
Note: Basically the ‘query:’ prefix enables the developer to use a full Sitecore XPath query against the database. Please notice that you can't use the | delimiter with query: as | has special meaning in Sitecore XPath.
Relative path definition, i.e. ./../item_001 Sample code: "query:./document//*" Returns all items that have the document as ancestor.