Lists Home |
Date Index |
> Question: does XPath/XSLT 2.0 grok substitution groups, such that
> you *could* write simply "//time" in a stylesheet and match either
> time-simple or time-complex elements?
Yes, or almost, as long as you have a schema-aware processor and
you've imported the relevant schema. If you have a schema that
<xs:element name="time" />
<xs:element name="time-simple" substitution-group="time" />
<xs:element name="time-complex" substitution-group="time" />
then you can match <time>, <time-simple> and <time-complex> elements
with the node tests "element(time)" or "element(time,*)". So you can
have a template like:
to match all three elements. However, a template like:
will still only match an element that is actually called "time".