Академический Документы
Профессиональный Документы
Культура Документы
Quick Reference
Also - child::para odd-numbered step children an abstract element child of a bookinfo child
@type step[not(position() mod 2)] of the book document element
the type attribute even-numbered step children Also -
Also - attribute::type /child::book/child::bookinfo/child::abstract
*[position() le 4] intersect step
../title from the first four element children, the step //para
the title element children of the parent children See also the “XQuery 1.0 & XPath all para elements in the document
* except title ancestor-or-self::*[exists(@lang)][1]/@lang 2.0 Functions & Operators Quick Also - /descendant-or-self::*/child::para
child elements except title elements Also - /descendant::para
Also - *[not(self::title)] (works in XPath 1.0)
the closest lang attribute on the context node Reference”
or an ancestor element /descendant::para[1]
ancestor::sec the first para element in the document
all sec ancestor elements Expressions that are not Location Paths Also - (//para)[1]
ancestor::sec/@n (@class,'none')[1] //@order-by
all n attributes on sec ancestor elements the class attribute, or if it does not exist, the all order-by attributes in the document
list/(item | step) string "none".
item and step element children of list Also - //list[exists(ancestor::list)]
children, in document order if (exists(@class)) then @class else "none" all list elements that have ancestor
//*/name() listelements
list/item, list/step
the names of all elements, in document order //list[not(ancestor::list)]
item element children of list children followed
by step children of list children distinct-values(//*/name()) all list elements that do not have ancestor list
the names of all elements, in document order, elements
preceding-sibling::step Also - //list[not(exists(ancestor::list))]
all preceding sibling step elements with duplicates removed
Sam Wilmott Also - //list[empty(ancestor::list)]
preceding-sibling::*[1][self::step] //name/string-join((first, last),' ')
a sequence of strings constructed from the sam@wilmott.ca //(* except title)
the directly preceding sibling element, if it is a http://www.wilmott.ca
step (otherwise nothing) name elements in the document, each one all elements except title elements
concatenating the values of its first and last and Also - //*[not(self::title)] (works in XPath 1.0)
descendant::div[last()] element children, in that order, joining them
the last div descendant of the current node with spaces Mulberry Technologies, Inc. //processing-instruction()[not(ancestor::sec/@n = 1)]
Also - for $n in //name return 17 West Jefferson Street, Suite 207 all processing instructions with no sec ancestor
.//div[last()] elements with n attributes equal to 1
string-join(($n/first,$n/last),' ') Rockville, MD 20850 USA
div descendants that are the last child div of
//*/count(ancestor-or-self::*) Phone: +1 301/315-9631 //para[matches(.,'[X|x]{3}')]
each of their parents
a sequence of numbers representing the Fax: +1 301/315-8285 all para elements whose value includes the
preceding::pb[1] depth of each element in the document info@mulberrytech.com regular expression [X|x]{3}
the first (most immediate) preceding pb http://www.mulberrytech.com Tip - [X|x]{3} matches three X or xcharacters
max(//*/count(ancestor-or-self::*))
ancestor::sec//pb intersect preceding::pb appearing in a row
the maximum depth of all elements in the
pb elements inside the same sec element as
document (a number in a singleton sequence) //sec[@id = //@rid/tokenize(.,'\s+')]
the context node, preceding it
for $stooge in ('Moe','Larry','Curly') all sec elements with id attributes whose
p[normalize-space()] values are also given as a value by a
returncount(//p[contains(.,$stooge)])
p child elements that have a non-whitespace the counts of all p elements in the document tokenized rid attribute anywhere in the
value (text content) mentioning each of "Moe", "Larry" and "Curly", document
*[not(node())] in that order Also - //sec[@id = $rid-values] where
empty element children (i.e., element children $rid-values is
index-of(('Moe','Larry','Curly'), speaker[1]) distinct-values(//@rid/tokenize(.,'\s+'))
with no node children) if the first speaker element child has the value Tip - use
*[not(node() except (comment()| "Moe", then 1; if "Larry", then 2; if "Curly", distinct-values(//@rid/tokenize(.,'\s+')) to
processing-instruction())] then 3; otherwise the empty sequence (i.e., no remove duplicates from the list of tokenized
element children that are empty (have no value) @rid values
children) except for comments or processing (: You’ve got to be kidding me. :) Tip - the regular expression \s+ matches any
instructions
do nothing. A comment is just a comment.
© 2007-2008 Sam Wilmott and contiguous sequence of spaces (space,
step[position() gt 1] Mulberry Technologies, Inc. linefeed or tab characters)
all step element children but the first 2008-07-21