I have an XSLT transformation that involves a template with
match =
"w:p[ancestor::w:body][preceding-sibling::*[1][self::aml:annotation/@w:type
= 'Word.Bookmark.Start']]"
What I'm matching on is a w:p element that is:
1.) Within a w:body element (at some level).
2.) Immediately preceeded by an aml:annotation element (whose @w:type is
'Word.Bookmark.Start').
This would seem to be a fairly simple match and, in fact, when I run it on a
fairly small XML input file it finishes quickly. However, when I run it on a
large (>6MB) XML file it appears to hang -- at least it has so far never
finished and I've given it an hour or so to try on a 1GB RAM, 2GHz machine.
This performance problem would seem to indicate that MSXML (the .Net
Framework 1.1 version) doesn't do much/any optimization on axis references.
I'm guessing that it is synthesizing a node set of the entire
preceding-sibling axis (which may be thousands of elements), then indexing
into it using [1]!
I'm off to finding a workaround, perhaps using xsl:key to speed things up,
but of course xsl:key has its own set of MSXML problems. Does anyone have
any suggestions how I might avoid this problem?
Thanks in advance,
Bill
PS - BTW, I'm trying to process a rather large Word 2003 doc via its WordML
representation.