[xsl] Should codepoints-to-string(1) work with XML version 1.1?

Subject: [xsl] Should codepoints-to-string(1) work with XML version 1.1?
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Thu, 09 Sep 2010 15:38:19 +0200
Using the XQSharp 2.0 beta I tried


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

<xsl:output method="xml" version="1.1"/>

  <xsl:template name="main">
    <test>
      <xsl:value-of select="codepoints-to-string(1)"/>
    </test>
  </xsl:template>

</xsl:stylesheet>

and the command line
xslt.exe -it main --xml11 sheet.xsl
results in error
"FOCH0001: Code point '1' is not a legal XML character in call to built-in function 'codepoints-to-string'."


When I instruct Saxon 9.2.1.2 to run that stylesheet with XML version 1.1 it allows the call and outputs

<?xml version="1.1" encoding="UTF-8"?><test>&#1;</test>

The codepoints-to-string specification only says
"If any of the code points in $arg is not a legal XML character, an error is raised [err:FOCH0001]"
it does not mention whether the definition of "legal XML character" is XML version dependent.


What do you think, if the XSLT processor supports XML version 1.1 and allows you to set it to use that version, should codepoints-to-string(1) work?



--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread