Re: [xsl] Help, my problem is n-cubed ... and so is my XSLT code

Subject: Re: [xsl] Help, my problem is n-cubed ... and so is my XSLT code
From: "Michael Kay michaelkay90@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Mar 2025 16:26:47 -0000
Three options:

(a) use xsl:key

(b) use an XSLT processor that optimizes joins (such as Saxon-EE) (but you may
need to write the search using predicates, not using xsl:for-each and xsl:if)

(c) build your own indexes as maps, as you suggest.

Michael Kay

> On 14 Mar 2025, at 15:57, Roger L Costello costello@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi Folks,
>
> My XSLT code must process N airport records.
>
> For each airport record, I must search through M air-nav records and collect
those that match on the ARPT_IDENT field.
>
> For each matched air-nav record, I must search through O boundary records
and collect those that match on the NAV_IDENT, NAV_CTRY, and NAV_TYPE fields.
>
> I've got an n-cubed problem, yes? My XSLT code implements the problem just
as I described: an xsl:for-each loop inside an xsl:for-each loop inside an
xsl:for-each loop. It's no wonder that the XSLT processor takes forever to
process my code.
>
> Is there some clever use of a data structure that will help deal with this
n-cubed problem? A clever use of the map data structure?
>
> Any suggestions you have for dealing with this problem would be
appreciated.
>
> /Roger

Current Thread