[
Lists Home |
Date Index |
Thread Index
]
Hi Uche,
> My foirst comment is that it should be generic annotation, not just
> type annotation. My thoughts would be:
>
> Add an "annotation" property to each node. This is a simple
> key/value pair where the key is URI (or is that anathema ;-) ) and
> the value is any XPath 1.0 object (which would even allow
> annotations to be cross-node links).
>
> You can access any particular annotation for any particular XPath
> object with a function lookup(annoitation-key). Of course, some
> facilities, such as optimizers, might use annotations behind the
> scenes, directly.
>
> Does this sound like a good general approach?
Definitely. This is very close to what David Rosenborg and I were
discussing at:
http://lists.xml.org/archives/xml-dev/200210/msg00212.html
and follow-ups.
Personally I'd use qualified names rather than URIs for the "lookup",
but that's because I envisage getting to annotation information
through an axis rather than through a function and because QNames are
easier to write than URIs. Perhaps a function:
annotations(node)
that returns a node set, and let the user use XPath mechanisms for
doing the lookup within that node set?
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
|