CDL parser - Import with Namespace doubts

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. Thanks Rakesh

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
participants (2)
-
Rakesh Sahu
-
Steve Loughran