![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - RE: How would we get xml tags in xsl if we have same element name >Thread Next - Re: How would we get xml tags in xsl if we have same element name Re: How would we get xml tags in xsl if we have same element nameTo: NULL Date: 7/12/2007 6:23:00 PM kamkaro wrote: > output: > Title: Redundant Group > Identifier = Q9D6L8 > db = dbj > Title: Database Cross-references > Identifier = Z98T23 > db = GENE Here is an XSLT 1.0 stylesheet that transforms each field element into a HTML table: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html lang="en"> <head> <title>Example</title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="field"> <table> <tbody> <tr> <th>Title:</th> <td><xsl:value-of select="title"/></td> </tr> <tr> <th>Identifier = </th> <td><xsl:value-of select="content/table/row/cell/idebtifier"/></td> </tr> <tr> <th>db = </th> <td><xsl:value-of select="content/table/row/cell/db"/></td> </tr> </tbody> </table> </xsl:template> </xsl:stylesheet> So what you are looking for is just a template matching field elements and then in that template you can construct whatever output you need for those elements and their descendant elements. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
