OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] RE : [xml-dev] Re: RE : [xml-dev] Text or tags choi ce wit

[ Lists Home | Date Index | Thread Index ]

Hi John,

> 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
contains:

<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:

<xsl:template match="element(time)">...</xsl:template>

to match all three elements. However, a template like:

<xsl:template match="time">...</xsl:template>

will still only match an element that is actually called "time".

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS