[cddlm] CDL parser - Import with Namespace doubts

Steve Loughran steve_loughran at hpl.hp.com
Tue May 23 06:26:43 CDT 2006


Rakesh Sahu wrote:
> Hi


> Our CDL parser implementation is complete and is able to successfully
> pass all the test cases. 
> 
> But we still have some questions about "import with namespaces" part of
> the spec.
> 
>  
> 
> As per the specs the namespace should be applied only to the toplevel
> element under cdl:configuration. This can cause problems during
> reference value resolutions. For now we are ignoring the namespaces
> during the lookup but this will cause problems in complex cases where
> there may be multiple imports and elements with the same name.
> 
> My take is that normal XML namespace scoping rules should be applied -
> the namespace declaration should explicitly be applied to the top
> element and to all elements within the content of that element.
> 

See my comments on the doc. I am not sure that we can meet all the 
conflicting needs of bits of the code by moving some or all of a local 
node into a namespace.

The needs are

-existing cdl:refroots work within a document that is imported into a 
new namespace
-existing cdl:ref paths work within a document that is imported into a 
new namespace
-resolve operations on deployed nodes correctly evaluate paths
-deployed components can retrieve attributes/nested elements by the 
qnames that worked when the component was compiled.

I can see the goal of the <import namespace> operation, but think that 
the need to evaluate roots and paths at runtime make it impossible to 
get right. If you look at how ant patches stuff into new namespaces, it 
does it when it constructs the object graph to match the XML, and it 
will let you use either the local or qualified name inside any element, 
working out what to do by relying on introspection inside the java class 
that matches the XML, and effectively dropping any namespace 
information. This only works because ant doesnt implement refs, refroots 
or xpath resoution operations against instantiated data

-steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CDL_Import_with_NS.doc
Type: application/msword
Size: 25600 bytes
Desc: not available
Url : http://www.ogf.org/pipermail/cddlm-wg/attachments/20060523/690376cd/attachment.doc 


More information about the cddlm-wg mailing list