Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - RE: XSLT challenge problem XSLT challenge problemTo: NULL Date: 9/2/2004 1:50:00 PM In general, I need to convert the number of occurences of several
nodes combined in the input document into a single numerical sequence
for sibling nodes in the output. Consider the following input XML:
<a>
<b>
<c/>
<d/>
<e>
<f/>
<f/>
</e>
</b>
<b>
<c/>
<d/>
<e>
<f/>
<f/>
</e>
</b>
<b>
<c/>
<d/>
<e>
<f/>
<f/>
</e>
</b>
</a>
OK, my new XML after XSLT needs to contain a number of sibling <X/>
elements. The exact number of occurances of this element will be
equal to the number of occurances of <c/>, <d/>, and <f/> combined
("Q"). Moreover, an attribute named "id", which is required on all
<X/> elements, will contain a unique identifier (a number) whose
maximum value naturally should always be equal to the number of <X/>
elements in the output.
<W>
<X id="Q"/>
<X id="Q - 1"/>
<X id="Q - 2"/>
...
</W>
Can somebody come up with a general solution? Thanx.
Duke Hamacher
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
