[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: mixed content nodes question
> > Or to one who doesn't like if's > > > ><xsl:template match="dictionary[lookup = '3']>Foo<xsl:/template> > ><xsl:template match="dictionary[lookup = '4']>Foo<xsl:/template> > My preferred way to do lookups is to make it table driven: <xsl:variable name="table"> <entry code="3" value="foo"/> <entry code="4" value="bar"/> </xsl:variable> <xsl:template match="dictionary"> <xsl:value-of select="$table/entry[@code=current()/@lookup]/@value"/> </xsl:template> Needs the xx:node-set() extension or the document("") cheat if using XSLT 1.0. Michael Kay http://www.saxonica.com/
|
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
|