[xsl] position() function problems on xalan

Subject: [xsl] position() function problems on xalan
From: "Florin Dragu" <florin.dragu@xxxxxxxx>
Date: Wed, 22 May 2002 18:06:41 +0300
Hi *,
I used xalan 2.0.0 and I'm trying to upgrade to xalan 2.3.1 (or any version
bigger than 2.0.1 so that I can use XSLTC - translets), but I have problems
with some stylesheets because of some XPath changes.
I have a XML that looks like the one bellow and an xslt in which I am trying
to select, let's say, the third (absolute) 'call' element.
In xalan 2.0.0 I did it like this: //call[position() = $current_call], where
current_call = 3, and it selected the call element from '<calls
type="D2-CorporateLink" header="Verbindungen aus dem D2-Netz">'.
In xalan 2.3.1 if I do the same I get all the call elements (or if
'current_call=1' I get 3 call elements, the first from each calls sub-tree).
If I change this to "//call[(count(preceding::call) + 1) = $current_call]" I
get the call element I want, but for big XML files (about 500 call elements)
it takes a lot of time (more than 10 times the time with xalan 2.0.0).
Does anybody know a different approach/solution to this?

Any ideea is welcomed.
Thanks,
Florin

<?xml version="1.0" encoding="UTF-8"?>
<telcoCallList>
	<calls type="Anrufe zu Sonderrufnummern" header="Verbindungen aus dem
D2-Netz">
		<call>
			<netValue>14.53</netValue>
		</call>
		<call>
			<netValue>14.53</netValue>
		</call>
	</calls>
	<calls type="D2-CorporateLink" header="Verbindungen aus dem D2-Netz">
		<call>
			<netValue>14.53</netValue>
		</call>
	</calls>
	<calls type="Gespräche - D2 zu D2 gruppenintern" header="Verbindungen aus
dem D2-Netz">
		<call>
			<netValue>14.53</netValue>
		</call>
		<call>
			<netValue>14.53</netValue>
		</call>
	</calls>
</telcoCallList>


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


Current Thread