Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: How to use xsl to format this xml tag [Thread Next] Re: How to use xsl to format this xml tagTo: NULL Date: 6/23/2009 5:37:00 PM Thanks Martin for that but This is what i'm trying to do below <xsl:for-each select=3D"order_notes"> <table class=3D"tabledetails" cellspacing=3D"0" style=3D"table- layout:fixed" border=3D"0" width=3D"645px"> <tr> <td width=3D"50px"></td> <td> <b style=3D"font-size:10pt;font-family:Tahoma;">Order Notes: </ b> <br/> <xsl:apply-templates select=3D"text"/> <br/> </td> </tr> </table> </xsl:for-each> As you would see i'm trying to put a break line and to format the node properly. The xml unfortunately isn't done properly as the nodes aren't unique Is this possible? Thanks On Jun 23, 9:25=A0pm, Martin Honnen <mahotr...@yahoo.de> wrote: > Patrick.O .Ige wrote: > > <order_notes> > > <text>*$199 SHARED =A0 =A0 =A0</text> > > <text>24MTHS </text> > > <text>AS PER AGREEEMENT PRE MAY. =A0 =A0</text> > > <text></text> > > <text>*BAN: 645938292 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </text> > > </order_notes> > > > How can i use xsl to format this node like this > > > *$199 SHARED > > 24MTHS > > AS PER AGREEEMENT PRE MAY. > > *BAN: 645938292 =A0 > > That looks like you want plain text output for each 'text' element that > has contents: > > <xsl:stylesheet > =A0 =A0xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" > =A0 =A0version=3D"1.0"> > > =A0 =A0<xsl:output method=3D"text"/> > > =A0 =A0<xsl:template match=3D"order_notes"> > =A0 =A0 =A0<xsl:apply-templates select=3D"text[text()]"/> > =A0 =A0</xsl:template> > > =A0 =A0<xsl:template match=3D"text"> > =A0 =A0 =A0<xsl:value-of select=3D"concat(normalize-space(.), ' = ')"/> > =A0 =A0</xsl:template> > > </xsl:stylesheet> > > -- > > =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML > =A0 =A0 =A0 =A0http://msmvps.com/blogs/martin_honnen/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
