[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: More efficient way than following-sibling?

Subject: Re: More efficient way than following-sibling?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 20 Mar 2002 16:26:24 -0500
following sibling exists
Michael,

This is not all that big a deal, but what you have is much the same as:

<xsl:apply-templates select="$TheNode/following-sibling::*[1]" mode="generic"/>

and then, instead of a template called by name, a mode:

<xsl:template match="*" mode="generic">
...
</xsl:template>

This will work since the apply-templates will simply fail in the event that no first following sibling element exists. So you don't have to wrap the call in a conditional.

Is that something like what you were after?

But it's the following:: axis that's the real killer, not following-sibling::.

Cheers,
Wendell

At 02:45 PM 3/20/2002, you wrote:
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?

--Michael Glick

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


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.