Re: [xsl] xsl:apply-templates - Specifying patterns

Subject: Re: [xsl] xsl:apply-templates - Specifying patterns
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 17 Dec 2001 11:20:42 +0200
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



Current Thread