[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: More efficient way than following-sibling?
Hello Michael! > I am trying to find a more efficient way to determine if a node has > siblings, and then access the next sibling. > > Currently, I am running the following XSLT code: > > <xsl:if test="$TheNode/following-sibling::node()"> > <xsl:call-template name="GenericTemplate"> > <xsl:with-param name="TheNode" > select="$TheNode/following-sibling::*[1]"/> > </xsl:call-template> > </xsl:if> > > However, this is very expensive, when it comes to large XML documents. > > Does anyone know a more efficient way to do this? The most efficient way I believe is to eliminate preliminary testing at all: <xsl:apply-templates select="$TheNode/following-sibling::*[1]" mode="foo"/> <xsl:template match="node() | @*" mode="foo"> <xsl:call-template name="GenericTemplate"> <xsl:with-param name="TheNode" select="."/> </xsl:call-template> </xsl:template> --- Oleg Tkachenko, Multiconn International, Israel XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|