[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath Query
> I imagine that I need > to call another template such as "third" below, You're making it look much more complicated than it is: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output method="html" indent="yes"/> <xsl:template match="DATA"> <table> <xsl:apply-templates select="HISTORY"/> </table> </xsl:template> <xsl:template match="HISTORY"> <tr> <td><xsl:apply-templates select="DESCRIPTION"/></td> <td><xsl:apply-templates select="../NAME[@CODE=current()/NAME]/PERSON"/></td> </tr> </xsl:template> </xsl:stylesheet> produces <table> <tr> <td>This is a history item 1</td> <td>Fred Bloggs</td> </tr> <tr> <td>This is a history item 2</td> <td>John Smith</td> </tr> <tr> <td>This is a history item 3</td> <td>Fred Bloggs</td> </tr> <tr> <td>This is a history item 4</td> <td>Fred Jones</td> </tr> <tr> <td>This is a history item 5</td> <td>Fred Bloggs</td> </tr> </table> on your input example. (which is what you asked for except that I downcased the html elements: that future proofs the code for moving to xhtml which is all lowercase.) David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|