This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Stripping carriage returns



<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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]