Subject: [xsl] 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 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XSL and VBScript variable, Howard Lim | Thread | [xsl] not simple (or simple? :-) xp, Daniel Bauke |
Re: [xsl] xml-cals-table to html-ta, Jirka Kosek | Date | RE: [xsl] ASP querystring in xmlnod, Gareth Sylvester-Bra |
Month |