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

Problems matching end-of-line character

Subject: Problems matching end-of-line character
From: Kenneth Stephen <marvin.the.cynical.robot@xxxxxxxxx>
Date: Wed, 10 Aug 2005 16:24:42 -0500
end of line character
Hi,

    I'm having trouble processing the &#x0A character. Here is a testcase :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
	<!ENTITY EOL "&#x0A;">
	<!ENTITY TAB "&#x09;">
	<!ENTITY SPACE "&#x20;">
]>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:exsl-common="http://exslt.org/common"
	xmlns:exsl-str="http://exslt.org/strings"
	version="1.0"
	extension-element-prefixes="exsl-common exsl-str"
	exclude-result-prefixes="exsl-common exsl-str">

	<xsl:variable name="var1" xml:space="preserve">
<a>
x<!-- The content of "a" is &EOL;x&EOL -->
</a>
	</xsl:variable>

	<xsl:variable name="var2" xml:space="preserve">
<a>
x <!-- The content of "a" is &EOL;x&SPACE;&EOL -->
</a>
	</xsl:variable>

	<xsl:template match="/">
		<xsl:if test="contains(exsl-common:node-set($var1)/a/text(),'&EOL;')">
			<xsl:message>Contains EOL(1)</xsl:message>
		</xsl:if>
		<xsl:if test="contains(exsl-common:node-set($var2)/a/text(),'&EOL;')">
			<xsl:message>Contains EOL(2)</xsl:message>
		</xsl:if>
	</xsl:template>

</xsl:stylesheet>

    Both Xalan 2.6.3 and Saxon 6.5.4 produce the following type of output :

file:///D:/xsl/code/testcases/Entities.xsl; Line #32; Column #17;
Contains EOL(2)
<?xml version="1.0" encoding="UTF-8"?>

    Why is the end-of-line in $var1 not visible?

Thanks,
Kenneth

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.