This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Comparison of nodes minus a child node
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Comparison of nodes minus a child node
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Wed, 31 Oct 2001 03:35:33 +0100
- References: <OF90B3048F.CA046940-ON86256AF5.007AD361@mmm.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Matt,
you don't need to wonder by such a frequently use of '//'. The transformer
has to test all descendants, not only the childs, if they are matching.
Imagine you have your 80.000 hierarchy-elements with all 7 childs -> 640.000
elements. And all of them the processor has to test whether they are
mathcing 'ListofHierarchies'.
Try to replace all '//' with a single slash '/'. The first few ones
($VAR/ListofHierarchies/Hierarchy) should cause no errors, because this is
exactly the xml-structure. At the other ones I would write exactly the
xml-structure too. NEVER use '//', especially in such huge files.
Hope this helps to get the time back to 5 min ;-)
Joerg
> <xsl:if test="$TODAY_PROD//ListofHierarchies or
> $YEST_PROD//ListofHierarchies">
> <xsl:variable name="TODAY_HIERS"><xsl:apply-templates select
> ="$TODAY_PROD//ListofHierarchies//Hierarchy"
> mode
> ="hierarchy"><xsl:sort/></xsl:apply-templates></xsl:variable>
> <xsl:variable name="YEST_HIERS"><xsl:apply-templates select
> ="$YEST_PROD//ListofHierarchies//Hierarchy"
> mode
> ="hierarchy"><xsl:sort/></xsl:apply-templates></xsl:variable>
> <xsl:if test="not($TODAY_HIERS=$YEST_HIERS)">
> <ListofHierarchies>
> <xsl:for-each select
> ="$TODAY_PROD//ListofHierarchies//Hierarchy">
> <xsl:variable name="IND_TODAY"><xsl:apply-templates
> select="." mode="hierarchy"/></xsl:variable>
> <xsl:if test="not($IND_TODAY
> = $YEST_HIERS//Hierarchy)"> <!-- Hierarchy is an Add -->
> <xsl:copy-of select = "."/>
> </xsl:if>
> </xsl:for-each>
> <xsl:for-each select
> ="$YEST_PROD//ListofHierarchies//Hierarchy">
> <xsl:variable name="IND_YEST"><xsl:apply-templates
> select="." mode="hierarchy"/></xsl:variable>
> <xsl:if test="not($IND_YEST
> = $TODAY_HIERS//Hierarchy)">
> <xsl:apply-templates select="." mode="delete"/>
> </xsl:if>
> </xsl:for-each>
> </ListofHierarchies>
> </xsl:if>
> </xsl:if>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list