Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] IGNORE CASE IN XSLT match [Thread Next] RE: [xsl] IGNORE CASE IN XSLT matchTo: Date: 10/1/2008 12:39:00 PM > I would like to find out ,is there any way to ignore case while > match template in XSLT. In some theoretical sense, the short answer is "no". XML is case sensitive, and thus a <mix> is simply a different element than a <Mix>. However, XPath (and thus XSLT) is perfectly capable of matching more than one element name at once: <xsl:template match=" mix | Mix "> ... </xsl:template> or performing string manipulation inside a predicate in a match, which is what Scott Trenda's solution takes advantage of: XSLT 2.0 ---- --- <xsl:template match="*[ lower-case( local-name() ) = 'mix']"> XSLT 1.0 ---- --- <xsl:template match="*[ translate( local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' ) = 'mix']"> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
