Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - newviw question: help to render this xml to html [Thread Next] RE: newviw question: help to render this xml to htmlTo: NULL Date: 12/2/2005 3:30:00 PM self-solution <xsl:template match="root"> <table> <xsl:apply-templates select="node()[ position() mod 2 = 1]" mode="row"/> </table> </xsl:template> <xsl:template match="*" mode="row"> <tr> <xsl:apply-templates select=". | following-sibling::node()[ position() < 2]" mode="column"/> </tr> </xsl:template> <xsl:template match="*" mode="column"> <td><xsl:value-of select="text()"/></td> </xsl:template> "Raffy Gim" wrote: > Hi, all, > I have this xml input. > <root> > <ns1>ns1C</ns1> > <ns2>ns2C</ns2> > <ns3>ns3C</ns3> > <ns4>ns4C</ns4> > <ns5>ns5C</ns5> > <ns6>ns6C</ns6> > <ns7>ns7C</ns7> > </root> > > and want to have > <table> > <tr><td>ns1C</td><td>ns2C</td></tr> > <tr><td>ns3C</td><td>ns4C</td></tr> > <tr><td>ns5C</td><td>ns6C</td></tr> > <tr><td>ns7C</td><td></td></tr> > </table> > > HOw can I transform with xslt? > > with many thx, > > Munhwan > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
