Match Patterns (Locating Elements)

Match Patterns (Locating Elements) One critical capability of a stylesheet language is to locate source elements to be styled. CSS, for example, does this with “selectors.” FOSIs do it with “e-i-c’s”, elements in context. XSLT does it with “match patterns” defined by the XML Path Language (XPath). XPath has an extensible string-based syntax. It describes “location paths” between parts of a document or …

Match Patterns (Locating Elements) Read More »

More Complex Patterns

section/*/note Matches <note> elements that have <section> grandparents. stockquote[@symbol] Matches <stockquote> elements that have a “symbol” attribute stockquote[@symbol=”XXXX”] Matches <stockquote> elements that have a “symbol” attribute with the value “XXXX“ emphasis|strong Matches <emphasis> or <strong> elements Pattern Syntax The XPath pattern syntax is described formally in the XPath specification. Here we’re going to look at the syntax in abstract, …

More Complex Patterns Read More »

Node Tests & Axis Specifiers

Node Tests & Axis Specifiers Node tests are most frequently element names, but other node tests are possible: name Matches <name> element nodes * Matches any element node namespace:name Matches <name> element nodes in the specified namespace namespace:* Matches any element node in the specified namespace comment() Matches comment nodes text() Matches text nodes processing-instruction() …

Node Tests & Axis Specifiers Read More »