[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A whitespace question, but probably not the same a

Subject: Re: 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
Re:  A whitespace question
----- 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.