[cddlm] Doubt about "Resolve" operation on System
Steve Loughran
steve_loughran at hpl.hp.com
Thu Aug 11 04:18:51 CDT 2005
Ayla Debora Dantas de Souza - Projeto Ourgrid wrote:
> Hello all,
>
> we are implementing the "Resolve" operation from the System and we had
> the following doubts:
> 1. What should happen if in the "path" we specify a prefix, but in the
> CDL being queried that prefix is not defined?
> As far as we know, XPath does not support queries using namespaces, only
> prefixes. Considering this, the prefix used must be defined on the XML
> being queried. Are we right?
>
That is an interesting thought. you may have found a bug there.
XPath always needs a context to resolve against; it takes the default of
a node, or you can pass in your own context of prefix,namespace pairs.
I guess we'd assumed that you could just rely on the context of whatever
descriptor you deployed, but xpath is a lot less brittle in code if you
provide your own context, as then you are not so dependent upon prefix
names, which are, after all, just conventions.
Maybe we need to extend the deploy+cmp apis to pass in a context for
resolution.
> 2. What must happen when the "path" passed for the "Resolve" does not
> present a prefix?
> We think that in this case, a response representing an emply result
> should be returned to the user. Ok?
i'd probably envisaged an error, but we need to work with the component
model design there.
>
> Thanks,
>
> Ourgrid team.
>
More information about the cddlm-wg
mailing list