Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 26th, 2013, 09: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
Reply With Quote
  #2 (permalink)  
Old November 26th, 2013, 10:17 AM
mhkay's Avatar
Wrox Author
Points: 18,252, Level: 58
Points: 18,252, Level: 58 Points: 18,252, Level: 58 Points: 18,252, Level: 58
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,929
Thanks: 0
Thanked 281 Times in 276 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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04:14 AM
JSP string find characters ndanger J2EE 2 November 24th, 2004 08:52 AM



All times are GMT -4. The time now is 12:27 PM.


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