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

Re: XPath question

Subject: Re: XPath question
From: Zack Brown <zbrown@xxxxxxxxxxxxxxx>
Date: Mon, 3 Feb 2003 14:48:42 -0800
Re:  XPath question
It seems like an interesting problem. Could you post the precise output
you'd like to see after running the below input through the xslt processor?

On Mon, Feb 03, 2003 at 05:21:54PM -0500, cknell@xxxxxxxxxx wrote:
> Every time I think I have a good grasp on XPath, it slips between my fingers. Consider the following XML:
> 
> <menu>
>   <item title="Vegetables">
>     <item title="tubers">
>       <item title="potatoes">
>         <item>Idaho</item>
>         <item>Maine</item>
>         <item>Russet</item>
>         <item>Yam</item>
>       </item>
>     </item>
>   </item>
>   <item title="Fruits">
>     <item title="Apples>
>       <item>Fuji</item>
>       <item>Granny Smith</item>
>       <item>Rome</item>
>   </item>
>   <item>Milk</item>
> </menu>
> 
> I have an HTML application for which I must flatten out the hierachy of this XML document, yet still maintain a link to the parent element for each child element. To this end I have decided to number each element according to its position in the hierarachy and use a "dot-delimitted" format for each element's id (i.01.03.11). I have struggled in vain today to come up with an XPath expression which would tell me how many elements are on the preceding-sibling axis of the parent of a given node. Can anyone straighten me out on this?
> 
> Thanks.
> -- 
> Charles Knell
> cknell@xxxxxxxxxx - email
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

-- 
Zack Brown

 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.