Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - How to use xsl to format this xml tag >Thread Next - Re: How to use xsl to format this xml tag Re: How to use xsl to format this xml tagTo: NULL Date: 6/23/2009 1:25:00 PM
Patrick.O .Ige wrote:
> <order_notes>
> <text>*$199 SHARED </text>
> <text>24MTHS </text>
> <text>AS PER AGREEEMENT PRE MAY. </text>
> <text></text>
> <text>*BAN: 645938292 </text>
> </order_notes>
>
> How can i use xsl to format this node like this
>
> *$199 SHARED
> 24MTHS
> AS PER AGREEEMENT PRE MAY.
> *BAN: 645938292
That looks like you want plain text output for each 'text' element that
has contents:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="order_notes">
<xsl:apply-templates select="text[text()]"/>
</xsl:template>
<xsl:template match="text">
<xsl:value-of select="concat(normalize-space(.), ' ')"/>
</xsl:template>
</xsl:stylesheet>
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
