Vadim Gritsenko wrote:

[EMAIL PROTECTED] wrote:

If I extend it to handle request / session / application context, which seem like a good idea, what syntax would be reasonable?

dom:/[request,session,context]/attribute-name/xpath

or maybe one should be a little bit more specific:

dom:/[request-attribute,session-attribute,context-attribute]/attribute-name/xpath




request-attribute is too verbose for my taste...



One could also have some kind of sub-protocols for choosing how the write
operation should be performed:


dom:write:/...



Write sub protocol is not needed, AFAIU.



dom:insert:/...



If node specified by the xpath does not exist, it will be created on write; otherwise -- replaced. If you want to insert after specific node... Yes, this will require some kind of indication... What other options exist except using sub-protocol?



WDYT?



My initial though was to have following syntax:


dom:[request|session|context]:<attribute-name>#<jxpath>

Xpath, and '#' symbol is obviously optional, and '#' was chosen for consistency with existing xmldb: protocol.


Just some thoughts:
- why "dom" only? We should also allow XMLizable objects.
- what about using input modules? We already have some modules that give access to all the above-mentioned attributes and more. This avoids code duplication, improves consistency and allows further extension by simply adding new input-modules.


Considering this, we should find another name for the protocol: "input-module" (too long), "module" (not significant enough), "xml-module" (better)?

And then the protocol syntax becomes:
 xml-module:<module-name>:<attribute-name>#<jxpath>

E.g. "xml-module:session-attr:purchase-order#item[1]"

WDYT?

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to