XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Path expressions – examples / A placeholder for names – the wildcard
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
When an element’s name is unknown but its position is known, the name in a path expression can be replaced by the wildcard *. This node test with * is also called a general NameTest:
*
This is a NameTest on the child axis matching element nodes of any name one level below the context. The expression selects every such element. This is useful when different elements should be processed in the same way.hallo/*
All elements, regardless of name, inside an element<hallo>directly below the context.*/gruss
All elements named<gruss>, inside an element of any name below the context./
This expression identifies the document node. This is a special case based on a function rather than an axis. (Note: The official expansion of this abbreviation is “fn:root(self::node()) treat as document-node()”.)/*
An element one level below the document node: the XML document’s root element.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn