Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Question on flow >Thread Next - Re: Question on flow Re: Question on flowTo: NULL Date: 4/2/2008 6:16:00 PM tshad wrote: > If it decides which one to choose, why if you have the pattern: > > <xsl:template match="FIELDS/*[starts-with(name(), 'SCMCOMMENTS')]"> > > does it know to use this one: > > <xsl:apply-templates select="FORMS/FORM/FIELDS/*[starts-with(name(), > 'SCMCOMMENTS')]"/> > > They aren't the same - but they are similar. Why did you leave FORMS/FORM/ > off of the template but not the apply-template? Well with the apply-templates you need to select the nodes you want to be processed and inside the 'REPORT' element template you want to process FORMS/FORM/FIELDS/*[starts-with(name(),'SCMCOMMENTS')]. If you did just <xsl:apply-templates select="FIELDS/*[starts-with(name(), 'SCMCOMMENTS')]"/> then that would not work as the 'REPORT' elements has no 'FIELDS' element children at all. The pattern given in match attribute of xsl:template can be shorter, you just need to make sure your patterns precisely match what you want to process and in that case it suffices to give the parent match="FIELDS/*[starts-with(name(), 'SCMCOMMENTS')]". If you want you can author that as <xsl:template match="FORMS/FORM/FIELDS/*[starts-with(name(), 'SCMCOMMENTS')]"> but for your input document it is not necessary and not different in the result. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
