Subject: RE: RE: Re: RE: how to reserve single space after transformation
From: cknell@xxxxxxxxxx
Date: Mon, 05 Mar 2007 16:35:58 -0500
|
AAGGGH!
I used my standard stylesheet template that contains the strip-space instruction! So naturally, the space was stripped. And, as Andrew stated, the xsl:preserve-space counter-acted the xsl:strip-space.
Sorry for the confusion.
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: cknell@xxxxxxxxxx
Sent: Mon, 05 Mar 2007 16:32:40 -0500
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Re: RE: how to reserve single space after transformation
My mistake. Here is the stylesheet I inferred from the original post.
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
<!-- <xsl:preserve-space elements="string" /> -->
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="category_label">
<xsl:copy-of select="." />
</xsl:template>
</xsl:stylesheet>
As is, it strips the space. If I un-comment the xsl:preseve-space instruction, the space is preserved.
i.e.,
<?xml version="1.0" encoding="UTF-8"?>
<category_label>
<string/>
</category_label>
versus
<?xml version="1.0" encoding="UTF-8"?>
<category_label>
<string> </string>
</category_label>
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Sent: Mon, 5 Mar 2007 21:18:25 +0000
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: RE: how to reserve single space after transformation
On 3/5/07, cknell@xxxxxxxxxx <cknell@xxxxxxxxxx> wrote:
> I just ran her stylesheet against her XML document with SaxonB 8.7.3, and got exactly the results she showed.
Strange... I didn't see any stylesheet in the original post...
Also I don't think xsl:preserve-space would help unless it was used to
counter xsl:strip-space.
|