Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSLT question: How to lookup another tag's children in XSLT

From: Joe Kesselman <keshlam-nospam@-------.--->
To: 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 /.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent