You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jon Smirl <jo...@mediaone.net> on 2000/07/23 06:09:16 UTC

Xalan-C: performance and pattern matches.

My stylesheets have about fifty templates defined like this:

<xsl:template match="*[@type='textarea']">
</xsl:template>
<xsl:template match="*[@type='button']">
</xsl:template>
......

Where type is being compared to various strings.

How is this dealt with, does Xalan do fifty compares on every node of my
document or is something more sophisticated like a hash table of the various
types built? A lot of my input nodes don't have a type defined so they'll
never match this set of templates.

This is also a good case of where an input schema would help the XSL
processor. The schema indicates that it is illegal for 'type' to appear on
many nodes of my input document. By checking the schema at compile time many
pattern matches could be avoided.

Jon Smirl
jonsmirl@mediaone.net