A
ajfish
Hi,
I am trying to allocate a unique ID to every instance of tag 'foo' in a
large XML document. currently I'm doing this:
<xsl:variable name="UniqueId">
<xsl:number count="foo" level="any"/>
</xsl:variable>
but with .Net framework 1.1 (using XPathDocument) it is very slow for
large documents (say 100mb with 100,000 foo tags in it). when I say
very slow, I am talking days and I would like it to take minutes !!
the only pure XSL alternative I've seen is to use position(). however,
the <foo> tags can occur at different levels within the document (and
might be nested), so I'm thinking that position would be difficult to
use. There are also other templates within the XSLT which perform other
processing.
the Id's I generate don't have to be contiguous but they must increase
the further you go down the document
is there any simple reliable solution, or should I just bite the bullet
and pre-process the document with C# to put in these Ids before running
the rest of the transform
Thanks
Andy
I am trying to allocate a unique ID to every instance of tag 'foo' in a
large XML document. currently I'm doing this:
<xsl:variable name="UniqueId">
<xsl:number count="foo" level="any"/>
</xsl:variable>
but with .Net framework 1.1 (using XPathDocument) it is very slow for
large documents (say 100mb with 100,000 foo tags in it). when I say
very slow, I am talking days and I would like it to take minutes !!
the only pure XSL alternative I've seen is to use position(). however,
the <foo> tags can occur at different levels within the document (and
might be nested), so I'm thinking that position would be difficult to
use. There are also other templates within the XSLT which perform other
processing.
the Id's I generate don't have to be contiguous but they must increase
the further you go down the document
is there any simple reliable solution, or should I just bite the bullet
and pre-process the document with C# to put in these Ids before running
the rest of the transform
Thanks
Andy