This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xsl:apply-templates - Specifying patterns


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]