This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:strip-space does not work?
- From: Nisheet Verma <NisheetV at rioport dot com>
- To: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Date: Fri, 16 Nov 2001 14:38:13 -0800
- Subject: [xsl] xsl:strip-space does not work?
- Reply-to: xsl-list at lists dot mulberrytech dot com
I am using a xml file which looks like, the following ( I have removed
insignificant text to improve readability)
?xml version="1.0"?>
<Catalog id="C31">
<object uri="http://developler.com/classdef;132">
<property uri="http://developer.com/propertyType;193">
1698.0||
</property
</object>
</Catalog>
I want to parse it using the following XSL
<?xml version="1.0" ?>
<!-- Passes a node set from one template to another -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes" />
<xsl:template match="object" >
<PRODUCT_ITEM >
<PRICE>
<xsl:value-of select="property/@uri"/>
</PRICE>
</xsl:template>
</xsl:stylesheet>
The out put looks like this
<PRODUCT_ITEM>
<PRICE>
1698.0||
</PRICE>
</PRODUCT_ITEM>
I don't know why xsl:strip does not strip out the whitespaces around PRICE
tag. I can use normalize-space() to make it work but that would be a hack.
I guess, xsl:strip=space should work, or am I using it incorrectly?
Any help would be much appreciated,
thanx
Nisheet
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list