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

Re: xpath question please

Subject: Re: xpath question please
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 30 Sep 2003 22:47:46 +0100
xpath grandchildren

> My xml source (typed carefully):
but indented _very_ strangely

        <WI order="1" title="doc1">
	     <Board sn="111"/> 
                 <Board sn="112"/> 


That indentation would suggest that 112 was a child of 111 but of course
it's a sibling, and they are both children of WI.
Your Xpath was lloking for Board grandchildren of WI so won't find
either of these.

        <WI order="3" title="doc3">
            <Boards>
	     <Board sn="111"/> 
                 <Board sn="112"/> 
    </Station>


That's not even well formed, the station element is closed at a point
that Boards and WI are still open.

It's hard to guess the real structure of your input given this.

>  For example, shouldn't {../@order} at this level given me
> the order attribute for WI?

No you are selecting Board elements that are grandchildren of WI (with
a Boards parent) ../@order would slect order from their parent but
that's Board not WI you need ../../@order. Although some of teh board
elements in your example were children of WI, some grandchildren and
some notwell formed at all, so its hard to be sure exactly

David

 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.