[xsl] Abstracting XPath queries

Subject: [xsl] Abstracting XPath queries
From: "Peter Eschenbrenner" <cen_sys@xxxxxxxxxxx>
Date: Wed, 26 Feb 2003 10:23:20 -0600
I am working on moving the code base of an existing application to and
XML/XSL engine.  The engine makes decisions based on rules that it gets
from one of 3 files:


For example, if I want the display name for a field I am pulling from a

<xsl:template name="displayName">
	<xsl:param name="currentRow" />
test="document('workspace.xml')/ROW[TableName=$tableName and
select="document('workspace.xml')/ROW[TableName=$tableName and
FName=$currentRow]/FDisplay" />
test="document('project.xml')/ROW[TableName=$tableName and
select="document('project.xml')/ROW[TableName=$tableName and
FName=$currentRow]/FDisplay" />
select="document('global.xml')/ROW[FName=$currentRow]/FDisplay" />
			<xsl:value-of select="@name" />

Now the problem I am encountering is scaling this query. There are 20
rules.  Some are only used once, some are used multiple times.  Then
there are an arbitrary number of rows in the table.

(3 file queries) * (~50 rule calls) * (Number of rows in table)

It gets out of hand quickly.

Options I have been considering:
Redesigning the rules file schemas to make them easier to navigate.
Pull all the needed rules at once and compile them into a stored

I am still learning.  This project is the first time I have ever used
XSL in a production environment.  Up to this point I have been using it
without all but basic XPath queries.

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

Current Thread