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

Re: climbing to the root element

Subject: Re: climbing to the root element
From: António Mota <amsmota@xxxxxxxxx>
Date: Wed, 16 Feb 2005 14:16:59 +0000
.nametext
That will be someting like 

ancestor-or-self::item[itemname/@nametype='multiple']/itemname/nametext


On Wed, 16 Feb 2005 14:24:11 +0100, Ke'tszeri Csaba <csaba@xxxxxxxxxxx> wrote:
> Hello!
> 
> My xml doc has a structure like the one at the end of this letter.
> If an item has a nametype=multiple, then I have to
> prefix their nametext with their containing item nametext.
> I have to repeate it as many times as multiple type items cascaded
> together, plus the one item with simple type above them.
> 
> The expected output is this:
> a
> b
> bi
> biv
> bj
> c
> 
> There are several other container elements between the simple and
> multiple type items, so i can't predict how deep I am, and how far
> should i look for the parent item.
> 
> My real problem is that I can't make a recursive function to go back
> to the / direction.
> 
> Could you give me some ideas?
> 
> Thank you!
> 
> Csaba
> 
> <xml>
>   <item>
>     <itemname nametype="simple">
>       <nametext>a</nametext>
>     </itemname>
>   </item>
>   <item>
>     <itemname nametype="simple">
>       <nametext>b</nametext>
>     </itemname>
>     <item>
>       <itemname nametype="multiple">
>         <nametext>i</nametext>
>       </itemname>
>       <item>
>         <itemname nametype="multiple">
>           <nametext>v</nametext>
>         </itemname>
>       </item>
>     </item>
>     <item>
>       <itemname nametype="multiple">
>         <nametext>j</nametext>
>       </itemname>
>     </item>
>   </item>
>   <item>
>     <itemname nametype="simple">
>       <nametext>c</nametext>
>     </itemname>
>   </item>
> </xml>

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.