[xsl] XSL taking very long

Subject: [xsl] XSL taking very long
From: "Tengshe, Ashish" <Tengshe.Ashish@xxxxxxxxxxxxx>
Date: Thu, 26 Aug 2004 14:02:58 -0500
This XSL transformation has been taking very long and after trying to minimize
all the other inefficiencies, I'm left with the following code that I don't
know how to minimize.

		<xsl:call-template name="process-categories">
			<xsl:with-param name="cats"
select="//vform[not(Category=preceding::vform/Category)]"/>
  		</xsl:call-template>

		<xsl:template name="process-categories">
			<xsl:param name="cats"/>
			<xsl:for-each select="$cats">
			<xsl:if test="Category != ''">
			<TR>
    			<TD NOWRAP="NOWRAP" VALIGN="TOP" ALIGN="LEFT">Cat: <xsl:value-of
select="Category"/></TD>
  			</TR>
  			</xsl:if>
  			</xsl:for-each>
		</xsl:template>


The XML is of the following format

	<?xml version="1.0" encoding="UTF-8"?>
	<Search>
	<SearchResults>
		<vform>
			<item_id>78987ghg98</item_id><rvsn_id>1</rvsn_id><title_txt><![CDATA[MY
NEWSLETTER]]></title_txt></vform>
		<vform>
		---
		---
		---
		100s of vform elements
		---
		---
	</SearchResults>
	</Search>


Let me know if you'd like the full XSL code.
Any ideas why it is taking so long (using Xalan) and can this output be
achieved by other means?
I appreciate your help!

Ashish D. Tengshe
IT System Analyst
Principal Financial Group
Tengshe.Ashish@xxxxxxxxxxxxx


-----Original Message-----
From: John-Patrick Stacey [mailto:jps@xxxxxxxxxxxxxxxxxxxxxxxx]On Behalf
Of J-P S
Sent: Thursday, August 26, 2004 1:52 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] XSL and infinite loops


On Thu, 26 Aug 2004, David Carlisle wrote:

) so if you are trying to avoid DOS attacks you could try to restrict the
) select attribute so it only uses Xpaths that select descendent children

Is there a danger list for such attacks? Presumably things like the
attributes on xsl:output etc. are right out; and anything in the
additional namespace of something like saxon: would be considered suspect.

Would it be possible to construct a SafeXSL stylesheet, that transforms
any dangerous XSL out? My first instinct is yes, because XSL is
functional, but that's only an instinct.

Cheers,
J-P
--
Just one small point for those Warwick supporters who've weighed in with the
argument that "We use microchips to find lost pets, so why not missing
children?". Chips in animals aren't tracking devices, they're used - because
pets can't talk - to establish who their owners are once the animals have
been
found. Or for identifying their bodies.

Current Thread