Figaro - The XML Database for the .NET Framework

A document's root can always be referenced using a single forward slash:

CopyXML
/

CopyXML
/Node1

To reference an attribute node, prefix the attribute node's name with '@':

CopyXML
/Node1/@class

To return the value contained in a node's text node (remember that not all element nodes contain a text node), use distinct-values() function:

CopyXML
distinct-values(/Node1)

To return the value assigned to an attribute node, you also use the distinct-values() function:

CopyXML
distinct-values(/Node1/@class)

Predicates

When you provide an XQuery path, what you receive back is a result set. You can further filter this result set by using predicates. Predicates are always contained in brackets ([]) and there are two types of predicates that you can use: numeric and boolean.