This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: A whitespace question, but probably not the same as the other one s
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] A whitespace question, but probably not the same as the other one s
- From: "Chris Nolte" <nolte at silicon-age dot com>
- Date: Thu, 7 Jun 2001 11:54:39 -0700
- Organization: Silicon Age, Inc.
- References: <1A3C5B43A705D311A7480060081FD21804CACA65@lnxcspexch01.lexis-nexis.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
----- Original Message -----
From: "Nice, Kerry A. (LNG-SHEP)" <Kerry.Nice@LexisNexis.com>
> <lnv:COUNSEL>Robert A. Sparks, Fairbanks, for
Appellant.<nl/><fb/><nl/>Mark
> E. Ashburn, Ashburn & Mason, Anchorage, for Appellees. </lnv:COUNSEL>
>
> <xsl:template match="lnv:COUNSEL">
> \par <xsl:text disable-output-escaping="yes"><I></xsl:text>
> <xsl:value-of select="normalize-space(.)"/>
> <!-- <xsl:apply-templates/> -->
> </xsl:template>
>
> and I get:
> \par <I> Robert A. Sparks, Fairbanks, for Appellant.Mark E. Ashburn,
Ashburn
> & Mason, Anchorage, for Appellees.
>
> the "Mark E." is right, but it never calls the <nl> and <fb> so I am
missing
> the "\par \par" between "Appellant." and "Mark"
This is very similar to the kinds of problems I had earlier [see thread
(mis)titled "element nodes in a string"].
normalize-space is a string function. When an element node is converted
into a string, all the markups contained by the element are stripped out
(for me this happened when I used substring-before and substring-after).
I am still looking for a solution to this. If you tried to use a
replace-substring template to replace linefeeds with spaces, you would have
the same problem of losing the <nl> and <fb> elements.
> I almost wonder if I wouldn't be better off just replacing all those
stupid
> <nl>, <fb>, etc nodes with the real text. I have to do some processing
and
Assuming your output mode is text, that might solve your problem. Something
like
<xsl:template match='nl'>ampersand#10;</xsl:template>
<xsl:template match='fb'>ampersand#32;</xsl:template>
[use an actual & instead of the word 'ampersand']
I haven't tested this. Let me know if/whether it works.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list