CDL q: what does this resolve to (cdl-2005-02-15.xml)

This is the test #cdl-2005-02-15, and it is failing on my system <cdl:cdl > <cdl:configuration > <node> <value cdl:ref="newvalue" /> </node> <toplevel cdl:extends="node"> <newvalue>newvalue</newvalue> </toplevel> </cdl:configuration> <cdl:system > <app> <user cdl:ref="value" cdl:refroot="toplevel"/> </app> </cdl:system> </cdl:cdl> The reason it is failing is that the reference under <node> only resolves once the thing has been extended; that is, cdl:configuration/node is itself unresolvable. , though cdl:configuration/toplevel is resolveable. My implementation tries to resolve everything under cdl:configuration, and fails because it is not possible here. It would work, if I marked the ref as lazy <node> <value cdl:ref="newvalue" cdl:lazy="true" /> </node> because then the deref would not take place. What do other people's implementations do with this test? -steve

On Tue, 24 Jan 2006, Steve Loughran wrote:
This is the test #cdl-2005-02-15, and it is failing on my system
<cdl:cdl > <cdl:configuration > <node> <value cdl:ref="newvalue" /> </node> <toplevel cdl:extends="node"> <newvalue>newvalue</newvalue> </toplevel> </cdl:configuration> <cdl:system > <app> <user cdl:ref="value" cdl:refroot="toplevel"/> </app> </cdl:system> </cdl:cdl>
The reason it is failing is that the reference under <node> only resolves once the thing has been extended; that is, cdl:configuration/node is itself unresolvable. , though cdl:configuration/toplevel is resolveable.
My implementation tries to resolve everything under cdl:configuration, and fails because it is not possible here. It would work, if I marked the ref as lazy
<node> <value cdl:ref="newvalue" cdl:lazy="true" /> </node>
because then the deref would not take place.
What do other people's implementations do with this test? -steve
Our implementation works just like yours - tries to resolve everything, even if it is not used under the 'cdl:system' element. But I think that like in any language to be compiled, a method/expression/command must be according to the language even if it is not invoked in the main program. As every reference must be valid (point to somewhere that exists), the reference in 'node' element is invalid, so this cdl. Maybe there's two ways to fix this test: 1. As you did, using the 'lazy' attribute. 2. Or put an empty 'newvalue' element that should be overriden when any element inherits it. Guilherme

Hello, The CDL processor's purpose is to resolve cdl:system, that is, individual prototypes (templates) does not have to be fully resolved unless it is required so to resolve cdl:system. In my implementation, the value reference resolution happens on demand. During resolution of cdl:system, node itself does not have to be resolved. Of course, if you try to access node direclty, <cdl:system > <app> <user cdl:ref="value" cdl:refroot="node"/> </app> </cdl:system> the resolution will fail. If you want every prototype (template) resolvable, node should be <node> <newvalue/> <value cdl:ref="newvalue"/> </node> If you add @lazy, the reference in cdl:system becomes unresolvable until deployment (which I guess is different from what you meant). Thanks, Jun Steve Loughran wrote:
This is the test #cdl-2005-02-15, and it is failing on my system
<cdl:cdl > <cdl:configuration > <node> <value cdl:ref="newvalue" /> </node> <toplevel cdl:extends="node"> <newvalue>newvalue</newvalue> </toplevel> </cdl:configuration> <cdl:system > <app> <user cdl:ref="value" cdl:refroot="toplevel"/> </app> </cdl:system> </cdl:cdl>
The reason it is failing is that the reference under <node> only resolves once the thing has been extended; that is, cdl:configuration/node is itself unresolvable. , though cdl:configuration/toplevel is resolveable.
My implementation tries to resolve everything under cdl:configuration, and fails because it is not possible here. It would work, if I marked the ref as lazy
<node> <value cdl:ref="newvalue" cdl:lazy="true" /> </node>
because then the deref would not take place.
What do other people's implementations do with this test? -steve
participants (3)
-
Guilherme M. G. Barbosa / Grad. DSC
-
Jun Tatemura
-
Steve Loughran