2

In a small XML conversion project I am working on, I am able to use the XSLT 1.0 translate() function to convert to lowercase or uppercase as suggested in posts like this one, so that something like the following works fine:

<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="translate(@value, $uppercase, $lowercase)" />

But really, I would prefer to use XSLT 2.0's lower-case() function, but for the following:

<xsl:value-of select="lower-case(@value)" />

...Chrome outputs nothing, and Firefox gets "unknown" error 0x8060000e, which maybe suggests that the lower-case() function isn't recognized. Perhaps my problem is something with the XML declaration line?:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

...or is there something else I'm missing?

Community
  • 1
  • 1
ewall
  • 27,179
  • 15
  • 70
  • 84
  • Probably neither Chrome nor Firefox support XSLT 2? – Jim Garrison Aug 17 '11 at 18:38
  • @Jim Garrison Huh... I just assumed it was a given that today's fast-changing browsers supported a 4 year-old standard, but [apparently not](http://p2p.wrox.com/xslt/59378-browser-support-xslt-2-0-a.html). Anyway, if you want to make your comment into an answer I'll give you the points for it. Thanks! – ewall Aug 18 '11 at 12:36

1 Answers1

1

Neither Chrome nor Firefox support XSLT2, in spite of its being a 4-year old standard. See for example this Firefox bug, languishing since 2008.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
  • Again, thanks for the tip. For this project I ended up using [Saxon](http://saxon.sourceforge.net/) for the heavy lifting anyway, but I miss the convenience of developing in the browser. – ewall Aug 18 '11 at 14:48
  • XSLT 2 with Saxon can now be used in the browser also with the Saxon-CE processor. – pgfearo Jul 13 '12 at 10:45