p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 (http://p2p.wrox.com/forumdisplay.php?f=398)
-   -   codepoints-to-string XML characters (http://p2p.wrox.com/showthread.php?t=91559)

hfmanson November 26th, 2013 10:27 AM

codepoints-to-string XML characters
 
Hello,

XML 1.0 documents are not allowed to contain control characters other than U+0009, U+000A, U+000D. The XPath function codepoints-to-string follows this restriction. However when using <xsl:output method="text"/> codepoints-to-string still doesn't allow other control characters. Shouldn't codepoints-to-string allow any Unicode character when the output is text?

Example:
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xsl xs">

<xsl:output method="text" encoding="ISO-8859-1"/>

<xsl:template match="text()|@*">
</xsl:template>

<xsl:template match="/">
<xsl:value-of select="codepoints-to-string((16))"/>
</xsl:template>

</xsl:stylesheet>

Kind regards,

Henri Manson
mansoft.nl

mhkay November 26th, 2013 11:17 AM

For better or worse, the restrictions on character set are present in the XDM data model and the string data type, not only in serialized XML.


All times are GMT -4. The time now is 10:54 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.