Re: [xsl] XSL Previous Node

Subject: Re: [xsl] XSL Previous Node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 16 Mar 2005 17:22:46 GMT
  I have an xml file that could look something like
  below.  Say I have a node called "servertype" that
  could occur at any level.  In my XSLT, when I am on a
  certain "servertype", I want to get find out exactly
   where in the xml was the previous and next instance of
  "servertype" node.  Key point is that "servertype"
  could occur at any level with the XML structure so I
  do not think preceding-sibling asex would work.  If I
  use ancestor axes then it ignores any previous
  instance of the "servertype" node at the same level.

If you want the previous use the previous:: axis rather than teh two you
mentioned, ancestor:: or previous-sibling::
Actually, depending on how you define previous, you may want to use


rather than


XPath doesn't consider ancestors to be previous nodes.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread
  • [xsl] XSL Previous Node
    • c p - Wed, 16 Mar 2005 09:14:50 -0800 (PST)
      • David Carlisle - Wed, 16 Mar 2005 17:22:46 GMT <=
      • <Possible follow-ups>
      • c p - Wed, 16 Mar 2005 09:28:31 -0800 (PST)