This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: correct use of keys?


> I have a stylesheet which, when run on a 10MB doc turns it into a 30MB
> doc in ~600 seconds.
>
> Even for such a large doc, this seems like along time given my machine
> is a 1.33GHz Athlon, 256MB.
>
It seems a long time to me, too. Which processor are you using? Are you
getting thrashing due to shortage of memory? If it takes this long on Saxon,
then I'm interested to find out why.

The repeated use of "node()[contains(name(), 'field')]" isn't particularly
nice. It suggests poor design of the XML document if the fact that an
element name contains a particular substring is so significant. You might be
better off doing a preprocess of the document in which elements whose name
contains 'field' are given an extra attribute, field="yes", and then use
this attribute in the second phase. In any case, I suspect that you are not
interested in all nodes whose name contains 'field', but only in elements
whose name contains 'field'. Replacing "node()" by "*" will speed things up
a bit.

And incidentally, you never need to specify "//" at the start of a match
pattern.

Mike Kay





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]