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

Re: top ancestor value

Subject: Re: top ancestor value
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Fri, 20 Oct 2006 17:02:46 -0500
Re:  top ancestor value
I think I need the first one (which worked YAY!) because the structure is like this:
<section id=1>
<section id=16>
<section id=17>
<section id=2>
<section id=30>

with 1, 16, and 17 needing the folder for 1 and 2 and 30 needing the folder for 2.

Although I could be missing something basic. None of the tutorials I found deal with nested data so I'm not sure how to apply it. They also don't seem to use namespaces.

Thanks for answering my basic questions.


David Carlisle wrote:
I tried using youth:ancestor-or-self::section[last()]/folder, but that gives me a validation error.

its the element name in the namepsace,not the axis


(guessing, as you didn't show the input)

on the otehr hand rather than going all the way up each time, you could
just start from the other end


if th etop level section is at some known position relative to th eroot
of the document.

As its a constant you can make it a global variable

<xsl:variable name="path" select="/a/b/youth:section/youth:folder"/>

then you can just use $path

ie replace by

<a href="{$path}/{youth:url}">


Current Thread


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.
First Name
Last Name
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.