Patterns (Windows CE 5.0)
A pattern is a type of expression that returns a set of nodes based on a set of conditions for a node. Nodes that satisfy the conditions match the pattern. The syntax for patterns is a subset of the syntax for expressions. In particular, location paths that meet certain restrictions can be used as patterns. An expression that is also a pattern always evaluates to an object of type node-set. A node matches a pattern if the node is a member of the result of evaluating the pattern as an expression with respect to some possible context; the possible contexts are those whose context node is the node being matched or one of its ancestors.
The following table lists examples of patterns.
Pattern | Matches |
---|---|
|
Any para element |
|
Any element |
|
Any chapter element and any appendix element |
|
Any item element with an olist parent |
|
Any para element with an appendix ancestor element |
|
The root node |
|
Any text node |
|
Any processing instruction |
|
Any node other than an attribute node and the root node |
|
The element with unique identifier W11 |
|
Any para element that is the first para child element of its parent |
|
Any para element that is the first child element of its parent |
|
Any para element that is the only para child element of its parent |
|
Any item element that has an items parent and that is not the first item child of its parent |
|
Any item element that is an odd-numbered item child of its parent |
|
Any p element with a div ancestor element that has a class attribute with value appendix |
|
Any class attribute (not any element that has a class attribute) |
|
Any attribute |
See Also
Location Paths | XQL Application Development
Send Feedback on this topic to the authors