[cddlm] Reference resolution and attributes

Steve Loughran steve_loughran at hpl.hp.com
Thu Feb 2 11:40:11 CST 2006


This is a query related to the reference resolution tests 02-0019 to 
02-0022, that are about to appear in the repository, and the resolution 
algorithm on p19-21

it matters to me, as I'm using some attributes to add dynamic type 
information for run time binding, and I want to be sure that I have 
understood the details.

cddlm-cdl-2005-02-0019
================
When you resolve a reference, the attributes of the source node are 
copied into the new destination node,

That is, this CDL

         <cdl:cdl>
           <cdl:system>
             <source attribute="value" cdl:ref="/dest" />
             <dest>dest</dest>
           </cdl:system>
         </cdl:cdl>
       </ct:resolve>

resolves to this

         <cdl:system>
           <source attribute="value" >dest</source>
           <dest>dest</dest>
         </cdl:system>
       </ct:resolved>

this is good, as it lets me declare type on a source that a reference 
does not need to redefine

cddlm-cdl-2005-02-0020
================

You do not merge in the attributes of the destination node.

In
         <cdl:cdl>
           <cdl:system>
             <source cdl:ref="/dest" />
             <dest attribute="value">dest</dest>
           </cdl:system>
         </cdl:cdl>
out
         <cdl:system>
           <source >dest</source>
           <dest attribute="value">dest</dest>
         </cdl:system>

If this is correct, I'm not so sure it meets my needs. I'd expect a 
reference destination to have the right to be fussier about its attributes.

cddlm-cdl-2005-02-0021
================

When you "copy all child nodes" (step 4.2), that includes attributes

         <cdl:cdl>
           <cdl:configuration>
               <dest>
                 <nested1 attr="value">nested1</nested1>
                 <nested2 attr="value2">nested2</nested2>
               </dest>
           </cdl:configuration>
           <cdl:system>
             <source attribute="value" cdl:ref="/" cdl:refroot="dest" />
           </cdl:system>
         </cdl:cdl>

         <cdl:system>
           <source>
             <nested1 attr="value">nested1</nested1>
             <nested2 attr="value2">nested2</nested2>
           </source>
         </cdl:system>
       </ct:resolved>

cddlm-cdl-2005-02-0022
================

When you "copy all child nodes" (step 4.2), that includes  text and 
comments.

         <cdl:cdl>
           <cdl:configuration>
             <dest>
               Text1
               <nested1 attr="value">nested1</nested1>
               Text2
               <nested2 attr="value2">nested2</nested2>
               Text3
             </dest>
           </cdl:configuration>
           <cdl:system>
             <source attribute="value" cdl:ref="/" cdl:refroot="dest"/>
           </cdl:system>
         </cdl:cdl>

resolves to

         <cdl:system>
           <source>
             Text1
             <nested1 attr="value">nested1</nested1>
             Text2
             <nested2 attr="value2">nested2</nested2>
             Text3
           </source>
         </cdl:system>

I've added all these tests; I hope we are at least consistent. Looking 
at test #0020, I would argue that merging attributes would be consistent 
with the sematics of cdl:extends ...

-steve





More information about the cddlm-wg mailing list