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

Carriage returns in attribute values (poss libxslt bug

Subject: Carriage returns in attribute values (poss libxslt bug)?
From: "Ramon M. Felciano @ Yahoo" <felciano@xxxxxxxxx>
Date: Tue, 20 Apr 2004 19:19:01 -0700
libxml carriage returns
Hi --

Are there any special rules around XSLT processing of string values from attributes vs text() nodes? I've noticed the libxslt seems to strip out carriage returns. CRs are probably pretty rare in attribute values, but MSXML seems to handle them ok so I'm wondering if there any special rules I don't know about. I took a quick look through the XSLT spec and didn't seen anything.

Here's how to reproduce it. Given this XML:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="U:\Active Workspace\Development\IKRS\CentralClassifier\libxslt-bug.xslt"?>
<libxml>
	<foo a="alpha
beta
delta"/>
</libxml>

and this stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="foo">
	<attribute><xsl:value-of select="@a"></xsl:value-of></attribute>
	</xsl:template>
</xsl:stylesheet>

MSXML produces:

<?xml version="1.0" encoding="UTF-8"?>
<attribute>alpha
beta
delta</attribute>

whereas libxslt produces:

<?xml version="1.0" encoding="UTF-8"?>

<attribute>alpha beta delta</attribute>

Any ideas?

Thanks!

Ramon

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.