This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: inserting space in xsl:value-of


> i have an xml which goes like this
>
> <?xml version="1.0" ?>
> <name>
> <text>welcome</text>
> <text>to</text>
> <text>amazon.com</text>
> </name>
>
> now i want to display the text in a text field using this
>
> <xsl:for-each select="TEXT">
>   <xsl:value-of select="normalize-space(.)" />
> </xsl:for-each>
> but i get a string which looks like this without spaces
> "welcometoamazon.com"
>

I don't know why the whitespace nodes are being stripped. It might be that
you are using <xsl:strip-space> in your stylesheet, or it might be that you
are using an XML parser (perhaps Microsoft's) that strips them by default.
If that's the case, change the parsing options to preserveSpace = true.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]