
Jun Tatemura wrote:
HI
XML namespace is a source of headache, when we need to import a fragment of XML from a document to document.. My interpretation is that, when we say @cdl:refroot has a QName value, it should be so in description time, not in resolution time. That is, the prefix must be interpreted where it is written.
I agree. I am starting to make an implementation notes doc in the documents/cdl directory on sourceforge where we can add clarifications.
An implementation headache is that we must carry over the namespace context from the original template.
Yes, that is what I do. when I create a reference path to resolve at run time, I cache the namespace declarations in scope at parse time for later use during resolution. The XML library I use (Xom) doesnt make this very public; its an O(depth*namespaces) operation for every node, so O(depth*namespaces*lazy nodes) for a full system.
<cdl:cdl > <cdl:configuration > <p1:local xmlns:p1="http://cddlm.org/prefix1"> <newvalue>prefix1</newvalue> </p1:local> <p1:local xmlns:p1="http://cddlm.org/prefix2"> <newvalue>prefix2</newvalue> </p1:local> <node xmlns:p1="http://cddlm.org/prefix1"> <value cdl:ref="/newvalue" cdl:refroot="p1:local" /> </node> <toplevel cdl:extends="node" xmlns:p1="http://cddlm.org/prefix2"> </toplevel> </cdl:configuration> <cdl:system > <app> <user cdl:ref="value" cdl:refroot="toplevel"/> </app> </cdl:system> </cdl:cdl>
cdl:extends at toplevel should be resolved to something equivalent to: <toplevel xmlns:p1="http://cddlm.org/prefix2"> <value cdl:ref="/newvalue" cdl:refroot="p1:local" xmlns:p1="http://cddlm.org/prefix1"/> </toplevel>
OK