[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problems with apersand (&) when trying to dynamica

Subject: RE: Problems with apersand (&) when trying to dynamically define a character value as an attribute value.
From: "Robert Eaton" <reaton@xxxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2006 15:13:01 +0100
xml apersand
>Write a throwaway XSLT 2 stylesheet that does
>
><chars>
>  <xsl:for-each select="20 to 65535">
>    <xsl:value-of select="codepoints-to-string(.)"/>>
>
>Paste the result into your XSLT 1 stylesheet inside an xsl:variable
>name="chars".
>
>Then in your XSLT 1 stylesheet do
>
>substring($chars, @character - 20, 1)
>
>Michael Kay

This looks like the neatest solution available to me but I am having a
bit of trouble getting it working. I have created the throw away XSLT
stylesheet with the following:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
	 <xsl:for-each select="32 to 65535">
    	<xsl:value-of select="codepoints-to-string(.)"/>
    	</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Then I have tried to process this with Saxon8 and get the following
error:

Saxon 8.8J from Saxonica
Java version 1.5.0_06
Stylesheet compilation time: 328 milliseconds
Processing file:/C:/saxon/amptest.xml
Building tree for file:/C:/saxon/amptest.xml using class
net.sf.saxon.tinytree.T
inyBuilder
Tree built in 0 milliseconds
Tree size: 7 nodes, 0 characters, 1 attributes
Error at xsl:value-of on line 5 of
file:/C:/saxon/generatecharstring.xsl:
  FOCH0001: Invalid XML character [x d800]
Transformation failed: Run-time errors were reported

Have I misunderstood what you meant?

Thanks,
Rob

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.