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

Re: Stripping carriage returns

Subject: Re: Stripping carriage returns
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 4 May 2000 09:46:23 +0100 (BST)
stripping carriage return from text
<xsl:template match="ric">
	<![CDATA[#]]>
		<xsl:value-of select="@name"/>
	<![CDATA[|]]>
	<xsl:apply-templates select="fid"/>
</xsl:template>

Those CDATA sections are not doing anything as neither # nor |
are special to XML so that is the same as

<xsl:template match="ric">
	#
		<xsl:value-of select="@name"/>
	|
	<xsl:apply-templates select="fid"/>
</xsl:template>

which means that the template consists of 4 nodes
the first text node consists of an end of line, 8 spaces, a # and an end
of line, then comes the value-of element node, then a text node with
again loads of white space and a | then the apply-templates node.

The text node with the end of line after the apply-templates does not
contribute to the template as it is all white and so stripped.

I would guess that you want

<xsl:template match="ric">
	<xsl:text>#</xsl:text>
		<xsl:value-of select="@name"/>
	<xsl:text>|</xsl:text>
	<xsl:apply-templates select="fid"/>
</xsl:template>

Now all the white space is in text nodes that are _only_ white and
so will all be stripped and not contribute to the template.

David

> This email is confidential and intended solely for the use of the
> individual to whom it is addressed.

So why send it to a mailing list that will archive it and stick it on a
public web page?


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.