xsl-list
[Top] [All Lists]

RE: Re: RE: [xsl] how to reserve single space after transformation

2007-03-05 14:32:56
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(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Andrew Welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>
Sent:     Mon, 5 Mar 2007 21:18:25 +0000
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  Re: RE: [xsl] how to reserve single space after transformation

On 3/5/07, cknell(_at_)onebox(_dot_)com <cknell(_at_)onebox(_dot_)com> 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.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--