xsl-list
[Top] [All Lists]

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

2010-09-09 08:38:35

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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>