This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:apply-templates - Specifying patterns
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 17 Dec 2001 11:20:42 +0200
- Subject: Re: [xsl] xsl:apply-templates - Specifying patterns
- Organization: Multiconn International
- References: <B7DE71A2878BD3119B2F00508B139CB202236C54@ex-ind-u1.vanenburg.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Ganesh Suriyanarayanan wrote:
> Iam trying to write an XSL to get a XML Instance of a XSD schema file,
> I need to search for a pattern apply template on that,
> like
> <xsl:template match="complexType//sequence">
>
> the source XSD can contain namespaces like
> <xsd:complexType>
> or
> <xs:complexType>
> or
> <complexType>
> how to write a generic patten match expression to handle this namespace
What do you mean as namespace is really just namespace prefix the only meaning of which is to point out at namespace URI.
So, you'd better declare schema namespaces in your stylesheet and use
your own favorite prefix.
<xsl:stylesheet ... xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
<xsl:template match="xsd:complexType//xsd:sequence"
Such kind of pattern will match sequence elements in "http://www.w3.org/2001/XMLSchema" namespace despite of their namespace prefixes in the source document.
--
Oleg Tkachenko
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list