XSLT Quick Reference
Node Tests
- node()
- Any Node of any type.
- *
- Any Node (of principle type, depends on context)
child::*
– selects all Element children
attribute::*
– selects all Attributes of context node
- text()
- Any Text Node
- comment()
- Any Comment Node
- processing-instruction()
processing-instruction(NAME)
- Any Processing Instruction Node
- If NAME provided, instruction must have same name to match.
- .
- The Context Node
Examples
child::FooBar
Child Element(s) named 'FooBar' in context node.
attribute::FooBar
Attribute(s) named 'FooBar' in context node.
FooBar/@*
Attributes of child Element(s) named 'FooBar'.
child::FooBar/child::BazFan
Child Element(s), named 'BazFan', with 'FooBar' Element parents
(that are children of the context node).
descendant-or-self::*/@*
All Elements and Attributes in the document.