Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 26th, 2013, 10:27 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
  #2 (permalink)  
Old November 26th, 2013, 11:17 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove First and Last Characters from String if it Contains Those Characters DoriftuEvo Excel VBA 9 September 22nd, 2009 09:01 AM
Replacing characters in a string semilemon C# 2005 2 June 16th, 2006 11:31 PM
swapping characters in a string pritz VB How-To 1 August 22nd, 2005 12:19 PM
How to eliminate special characters from string dadahonde VB How-To 2 March 11th, 2005 05:14 AM
JSP string find characters ndanger J2EE 2 November 24th, 2004 09:52 AM





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