13

I'm editing an XSLT 2.0 document in emacs and get an "attribute value invalid" error on the version number, i.e.,

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

If I replace the "2.0" with "1.0" I don't get an error in emacs (but then there are errors processing the stylesheet).

Does emacs not support XSLT 2.0? Is there some external schema I can get that will work? Worst case, will nXML still help me correctly with the rest of the document, even if I just live with this error?

Marc Stober
  • 10,237
  • 3
  • 26
  • 31

1 Answers1

17

Norman Walsh's xslt20.rnc schema should do the trick. See https://github.com/ndw/xslt-relax-ng.

You can register xslt.rnc as the schema document for both XSLT 1.0 and 2.0 (it references xslt10.rnc and xslt20.rnc).

mzjn
  • 48,958
  • 13
  • 128
  • 248
  • Perfect and thanks for the fast reply! I had seem some old references to this files but couldn't find a site to download them from. I just copied them into the directory where emacs already had a single xslt.rnc file and it seems to work...hopefully that was the right thing to do. – Marc Stober Nov 06 '11 at 15:46
  • What's that directory then? My emacs doesn't have any xslt.rnc files anywhere or I can't find them and have the exact same issue in nXML mode – Marcus Junius Brutus May 24 '13 at 14:38
  • Schema files should be put in a directory that can be located by nXML as described in the documentation: http://www.gnu.org/software/emacs/manual/html_node/nxml-mode/Locating-a-schema.html – mzjn May 24 '13 at 15:11