cocoon-dev mailing list archives

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

> 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.

aggreed

>
> 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...
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message