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

XPath to Find All Siblings Except Self

Subject: XPath to Find All Siblings Except Self
From: "Rick Quatro" <rick@xxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2012 13:51:38 -0400
 XPath to Find All Siblings Except Self
I have the following XML file:

<?xml version="1.0" encoding="UTF-8"?>
<chapter>
    <section level="1">
        <title id="1003261">Camshaft Cover</title>
        <section level="2">
            <title id="1003269">Removal</title>
            <paragraph id="1003264"/>
        </section>
        <section level="2">
            <title id="1003262">Rebuilding</title>
            <paragraph id="1003265"/>
        </section>
        <section level="2">
            <title id="1003321">Installation</title>
            <paragraph id="1003322"/>
        </section>
    </section>
</chapter>

When my context is a particular level 2 section element, I need to find all
of the title elements of the sibling level 2 elements, except for the
current level 2 section's title. So, for example if my context is the
Removal section, I want to find the Rebuilding and Installation titles. I am
using this, but it is returning all of the level 2 titles:

parent::section/section[not(self)]/title

Thanks in advance for any help.

Rick Quatro
Carmen Publishing Inc.
*** 585-283-5045 *** NEW NUMBER
rick@xxxxxxxxxxxxxxx
http://www.frameexpert.com

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.