[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: basic xpath question
Try this code..
Hope this helps.. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" media-type="html"/> <xsl:template match="/"> <p> <xsl:for-each select ="//section"> <xsl:choose> <xsl:when test="./@id = 'url'"> <xsl:element name="a"> <xsl:attribute name="href"><xsl:value-of select="./@url"/></xsl:attribute> <xsl:value-of select="."/></xsl:element> </xsl:when> <xsl:otherwise><xsl:value-of select="text()"/></xsl:otherwise> </xsl:choose> </xsl:for-each> </p> </xsl:template> </xsl:stylesheet> Cheers Vasu From: "Hanlan, Dominic - Senior Developer" <dhanlan@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: "'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx> Subject: basic xpath question Date: Thu, 20 Jun 2002 10:11:25 +0100 _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. 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
|