[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 ones
From: "Nice, Kerry A. (LNG-SHEP)" <Kerry.Nice@xxxxxxxxxxxxxx>
Date: Thu, 7 Jun 2001 10:06:32 -0600
whitespace
Ok, good call.  I had forgotten I set:
        parser.setFeature(
"http://apache.org/xml/features/dom/include-ignorable-whitespace",
                               false );  
to fix another problem.  Now I need to figure out how to fix those other
problems.  But the ones I've tried so far I seem to be able to control with
normalize-space().  I tried so many different things, I lost track of what I
tried.  I guess if the whitespace wasn't there in the first place, nothing I
did in the stylesheet would matter.

Kerry.

-----Original Message-----
From: Dimitre Novatchev [mailto:dnovatchev@xxxxxxxxx]
Sent: Thursday, June 07, 2001 12:41 AM
To: Kerry.Nice@xxxxxxxxxxxxxx
Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: A whitespace question, but probably not the same as the
other ones


--- Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
> 
> Your xml parser (most probably MSXML) is ignoring the whitespace-only
nodes.
> To make it include whitespace-only nodes in the case of MSXML set:
> 
> objXMLDOMDocument.preserveWhiteSpace = true;
> 

Another possible cause is that two normalised values are concatenated, and
the
ending white space of the first one and the starting whitespace of the
second one
were eliminated. this can happen like in the following example:

<x>
    <a> Some text </a>
    <b> Some more text </b>
</x>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text" />

    <xsl:template match="x/*">
        <xsl:value-of select="normalize-space()" />
    </xsl:template>
</xsl:stylesheet>

Result:
------
Some textSome more text


To avoid this, reproduce the starting and ending characters of a text node
and
normalise the rest of it.

Or, concatenate text nodes and only then normalize-space() the
concatenation.


Dimitre Novatchev.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 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.