[Home] [By Thread] [By Date] [Recent Entries]
Mike,
How about simply <xsl:template match="list/@type"> ... cool code ... </xsl:template> which is more concise and easier to maintain than either a distinct mode, or name-testing on the parent (which shouldn't require passing a parameter in any case)? More generally, I think problems like Jacqueline's are usually dealt with most simply at the level of the list, where the "natural" mapping to the result element will be: <xsl:template match="list"> do stuff for lists </xsl:template> <xsl:template match="list[@type='special']"> do stuff for special lists </xsl:template> Because of the template matching rules, the second template will apply when it can, and the first will apply when the second one can't. Note that when you've matched an attribute, <xsl:apply-templates/> won't get you the contents of the element since they're not inside the attribute. So matching attributes is most common when we're just adding a bit of generated text or some such. Cheers, Wendell At 01:07 AM 8/24/2006, you wrote: Jackie, If you want to write templates for common attributes, you can distinguish them in two ways (XSLT 1.0).
|

Cart



