Re: [xsl] IGNORE CASE IN XSLT

Subject: Re: [xsl] IGNORE CASE IN XSLT
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Fri, 26 Nov 2004 22:36:52 +0100
On the other hand, you could do something like:

<xsl:template match="*[translate(name(), 'ABC..', 'abc..') = 'italic']">
  <!-- Yuck... -->
</xsl:template>


This will work (I think... it seems like it should but I havent tested it to check) but the easier way to do this is to simply use the union method for matching multiple elements:

<xsl:template match="italic | Italic">
proccesing code...
</xsl:template>

Hope this helps!

<M:D/>

It will not help a lot if one cannot predict the use of case in element names. :-( Especially documents that originate from HTML of SGML have this problem, as HTML and SGML are case insensitive...


It even gets worse if you have to account for ancestors as wel... :-(

It would have been nice if the XSL standard would have provided a case sensitivity option. But on the other hand, it is actually more a job for XML parsers. Are there XML Parsers that have an option to ignore case of the input? (not using a declaration file)

Grtz,
Geert

Current Thread