Re: [xsl] Selecting lots of nodes with lots of criteria

Subject: Re: [xsl] Selecting lots of nodes with lots of criteria
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 02 Sep 2010 16:42:14 +0100
On 02/09/2010 16:12, Fabien Tillier wrote:
Hi List.
I think I have reached some limitations of the XSL parser.


I am trying to select a list of nodes from a document based on criteria
like
<xsl:call-template name="tab208">
<xsl:with-param name="rows"
	
select="//Row[NUMERO=1]|//Row[NUMERO=2]|//Row[NUMERO=3]|//Row[NUMERO=4]|
//Row[NUMERO=5]|//Row[NUMERO=6]|//Row[NUMERO=7]|//Row[NUMERO=8]"/>
</xsl:with-param>
</xsl:call-template>



// is a very expensive operation 9search the entire file to arbitarty depth) and | is quite expensive as well 9sort into document order, so you are relying greatly on the ability of the xsl system to optimize this.

/x/Row[number(NUMERO) ge 1 and number(NUMERO) le 300]

is likely to put a lot less stress on the system.
The real selection list can have more than 2000 criteria, and Kernow
gets stuck while trying to read the xsl.
Thus, I am pretty sure I am using a bad way to make this selection.
The other side is that I have about 300 different templates, like the
one called above, each with a selection list that is different.
And the XML file I am parsing can get pretty big too... (more than 10000
"Row" nodes)
I can have the criteria as a list (like 1,2,3,etc...), but I don't know
how to express it in the select part (This XSL is generated from a big
XML file, so I haven't input the arguments by hand !).

If it's in an xpath sequence $x then


NUMERO=$x

tests if NUMERO is equal to any item in x.

Any help would be appreciated, I am really stuck.


Best regards,
Fabien



David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread