Subject: RE: XSL Filtering From: Linda van den Brink <lvdbrink@xxxxxxx> Date: Tue, 8 Aug 2000 12:23:02 +0200 |
For the sample XML you posted, > > <TABLE> > <RECORD> > <TYPE>Red Barn</TYPE> > <COST>$195</COST> > <SKU>JHD384234</SKU> > <AVAIL>No</AVAIL> > </RECORD> > </TABLE> The following works: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html"/> <xsl:template match="/"> <table> <xsl:for-each select="TABLE/RECORD[contains(TYPE,'Barn')]"> <tr> <td><xsl:value-of select="TYPE"/></td> <td><xsl:value-of select="COST"/></td> <td><xsl:value-of select="SKU"/></td> <td><xsl:value-of select="AVAIL"/></td> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet> There were several errors in the code you posted. - You were looking for a DESCRIPTION elemement that contained 'Barn', but there is no such element in your source. I guess you mean TYPE. - You were looking for the string 'Barn' but in your source it was written in all caps, 'BARN'. That would not result in a match. - Your <xsl:value-of select=""/> weren't closed. Hope this helps, Linda XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Ultimate arbitrary sort algorit, Steve Muench | Thread | formatting first item differently t, Eric Taylor |
Re: Bug in 'xsl:sort'. ( XT vs SAXO, James Clark | Date | RE: key() Re: Saxon VS XT, Thorbjørn Ravn Ander |
Month |