Hi, all

Comments interspersed below.
----- Original Message -----
From: "James Strachan" <[EMAIL PROTECTED]>


> Hi Scott
>
> Congratulations, both on your wedding and on a great piece of development
> work!
>
> Just a thought, how about calling it JTags? Then we'd have XTags for
working
> with XML and JTags for working with Java objects (& beans, arrays,
> Collections, Maps etc). Nice similarity there?

That would be fine

> Also seperating out the expression language from the tag library might be
> useful too - certainly Struts may find it useful, I'm sure other projects
> will as well. Maybe jakarta-commons might be a good place for the
expression
> language code to live then it could be used in various (Jakarta &
> non-Jakarta) projects - maybe Velocity / Anakia too? I can imagine it
being
> useful in tools as well such as IDEs, debuggers etc.
>
>
> Finally a couple of comments about your expression language...
>
> * I'd prefer it if you used the "/" character for the path seperator
rather
> than ".".

Yeah, I debated that one a bit myself.  The "." seems more natural to me,
but there are advantages to XPath compatibility as well.  I'd like to hear
what others think.  The "/" does avoid some naming conflicts.  However,
perhaps a better way to be able to reference Java objects with pure XPath
would be to use a data binding mechanism.

> * Relative / absolute paths and variables.
>
> One neat feature of XPath and XTags / XSLT is that by default path
> expressions are relative. So you can do things like...
>
> <xtags:forEach select="order">
>     <!-- context is now an order -->
>
>     order's id is:
>      <xtags:valueOf select="id"/>
>
>     <xtags:forEach select="item">
>         <!-- context is now an item -->
>
>         product name is:
>         <xtags:valueOf select="product/name"/>
>     </xtags:forEach>
>
> </xtags:forEach>
>
> In the above, the two <forEach> tags are relative to the 'current context'
> like in XSLT / XPath. So nested <forEach> tags can be used to efficiently
> navigate down a complex tree structure. So in XPath you can be relative
>
>     name     = name element of current context
>     /name    = name element of root context
>     $name   = name variable
>
> I don't yet see how this kind of relative navigation and lookup of
variables
> can be done in your expression language. i.e. how to specify the
difference
> between
>
> <xtags:forEach select="order">
>
>     relative customer for current order
>
>     <xtags:valueOf select="customer"/>
>
>     variable customer...
>
>     <xtags:valueOf select="$customer"/>
>
> </xtags:forEach>
>
>
> Though the scope axis might have something to do with it? Would your
> expression language be something like this?
>
> <jtags:forEach select="order">
>
>     relative customer for current order
>
>     <jtags:valueOf select="customer"/>
>
>     variable customer...
>
>     <jtags:valueOf select="page:customer"/>
>
> </jtags:forEach>
>

In this cut of the expression language, I chose to make all references
absolute.  To me, that cleared up a lot of the confusion I tend to have with
XPath.  There are two ways to access the current element in a forEach:

* the curent() function
* give the element an id, and reference it by name

The scope axis isn't meant to be a mechanism for that.

Hope that helps, now, off to Hawaii for me!

Scott

Reply via email to