Re: [xsl] A whitespace question, but probably not the same as the other one s

Subject: Re: [xsl] A whitespace question, but probably not the same as the other one s
From: "Chris Nolte" <nolte@xxxxxxxxxxxxxxx>
Date: Thu, 7 Jun 2001 11:54:39 -0700
----- Original Message -----
From: "Nice, Kerry A. (LNG-SHEP)" <Kerry.Nice@xxxxxxxxxxxxxx>
> <lnv:COUNSEL>Robert A. Sparks, Fairbanks, for
Appellant.<nl/><fb/><nl/>Mark
> E. Ashburn, Ashburn &amp; Mason, Anchorage, for Appellees.  </lnv:COUNSEL>
>
> <xsl:template match="lnv:COUNSEL">
> \par <xsl:text disable-output-escaping="yes">&lt;I&gt;</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


Current Thread