cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <>
Subject Re: [Announcement] sitemap variables
Date Thu, 10 Oct 2002 18:06:56 GMT

> The sitemap variables are, as you say, a list and not a tree. Writing
> "../" makes sense because - a tree node having only one parent - it has
> the same meaning in a list an in a tree : "go to the previous element".
> To crawl the list from its start, using the "/" seems to me a bad choice
> (see all the confusion it produces) since our minds have been biased for
> years and see in this character the symbol of a *tree* navigation, which
> must be followed by something identifying a child in the tree.


> So we should invent another syntax, and a numbered one seems good to me
> as - let's remind it - we're navigating in a list.

hm.. true!

> So what about a numbered syntax such as "[/pos/]/name/". Pos is a number
> which, if positive starts from the root, and if negative starts from the
> current element. So :
> - "[1]foo" is the root variable "foo"
> - "[2]1" is the variable "1" of the top-level matcher
> - "[-1]foo" is the "foo" variable of the immediate parent of the current
> statement
> - etc.
> Note that the index comes _before_ the variable name to avoid any
> confusion with XPath or Java arrays where "foo[2]" means "second element
> of foo".

But then negative number would be relative and positve would be absolute :-/

> Of course, we keep the "../" syntax.

Of course!

I guess I need to sleep over this...

To unsubscribe, e-mail:
For additional commands, email:

View raw message