|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: trying to create a node-set of attribute nodes
Hi Ankit, > I too have a similar problem : > > <xsl:template match="Annotation/@type[. = 'interesting']"> > <DIV style="background:Yellow"> > <font face="Arial" color="RED"> > <xsl:apply-imports/> > </font> > </DIV> > </xsl:template> > > I would like to apply tempplate to all <Annotation> tags which have > their "type" attribute value="interesting". The above template *matches* 'type' attributes whose value is 'interesting'. If you want to apply templates to such attributes, then you need to use something like: <xsl:apply-templates select="@type[. = 'interesting']" /> in a template where the context node is an <Annotation> element. Note that unlike elements, attributes do not get templates applied to them unless you explicitly tell the processor to do so. Perhaps you actually want to match <Annotation> elements whose type attribute is 'interesting'? In that case, use: <xsl:template match="Annotation[@type = 'interesting']"> ... </xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|

Cart








