ressources: http://www.w3schools.com/xquery/default.asp reference: http://www.w3schools.com/xquery/xquery_reference.asp xpath: nodename root: / all matching descendants: // current: . parent: .. select attributes: @attr predicates: [pred], [1], [last()-1], [position()<3], [@lang], [@lang='eng'], [price>35.00] wildcards: any element: * any attribute: @* any node: node() several paths: p1 | p2 axes: axisname::nodetest[predicate] ancestor, ancestor-or-self, attribute, child, descendant, descendant-or-self, following, following-sibling, namespace, parent, preceding, preceding-sibling, self operators: | + - * div = != < >= > >= or and mod select: doc("books.xml")/bookstore/book[price>30]/title flwor: for $x in select_query where $x/predicate order by $x/xpath return $x/xpath html: conditional statements: for $x in doc("books.xml")/bookstore/book return if ($x/@category="CHILDREN") then {data($x/title)} else {data($x/title)} modify result: add elements/add attributes: return
  • {data($x/title)}. Category: {data($x/@category)}
  • for: for $x in (1 to 5) for $x at $i in doc(... let $x := (1 to 5) functions: built-in: http://www.w3schools.com/xpath/xpath_functions.asp uppercase() substring(str,start,len) user-defined functions: declare function prefix:function_name($parameter AS datatype) AS returnDatatype { ... } check: xlink, xpointer