Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT question: How to lookup another tag's children in XSLT >Thread Next - Re: XSLT question: How to lookup another tag's children in XSLT Re: XSLT question: How to lookup another tag's children in XSLTTo: NULL Date: 10/1/2006 10:48:00 AM Roy: you might want to look up the description of named templates, since you're off-base on that point. yinglcs: He does have a point; you'll get more and better help if you don't post obviously sloppy examples. > <xsl:template name="feature"> ... </xsl:template> > intead of > <xsl:template match="feature"> ... </xsl:template> > I don't match any 'feature' element. If you want the template to be executed by apply-templates matching, you must use match= with a match pattern. If you want it to run when you invoke it explicitly by name with call-template, you must use name= with a literal name. If you want the same template to be invoked both ways, you need to specify both. In this case, you seem to want it running only with call-template, though I don't quite see why you're doing it that way. >2. Why this does not match anything? I expect this will loop thru each >children of "features" and call the name template 'feature'. But >apparently, I did something wrong. > <xsl:template match="/features"> /features matches <features> if and only if it's the outermost element (child of root). Get rid of the /. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
