![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Select multiple nodes in XSL [Thread Next] Re: Select multiple nodes in XSLTo: NULL Date: 12/2/2004 10:51:00 PM > <xsl:template match="header1 | header2"> > <!-- rest of the template --> > </xsl:template> > > And I call it by: > > <xsl:apply-templates select="header1 | header2"/> > > The issue I'm having is that my XSL is being executed twice, once for > each node (header1 and header2) rather than going thru both nodes at > once. The goal is to go thru both nodes at once. Any assistance > would be appreciated. > > you select all header1 and header2 nodes and apply templates to them, each of those templates is going to execute -- rest of the template -- actualy they may be executed in any (time) order but the results will be merged in to the result tree based on position of the nodes in the source. So since you have a header1 and a header2 in your example source you get the results of transforming those nodes. I can't guess from your description what result you _did_ want so can't suggest any change to the xsl. It may be that the templates for header1 and header2 are exeecuted "at once" in a concurrent xslt implementation, but clearly (or not?) the results of each template exeution have to be attatched to the result tree at different points. It would help if you said what output you need from your sample input. If you only want to process at most one header you could do <xsl:apply-templates select="(header1 | header2)[1]"/> but that processes one and ignores the other, which doesn't seem to match the description of your desired outcome. David | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
