RE: CMChildren

> -----Original Message-----
> From: Sander Bos [mailto:sander@x-hive.com]
> Sent: Tuesday, February 27, 2001 11:59 PM
> To: www-dom@w3.org
> Subject: Re: CMChildren
> 
> 
> 
> > I found the description of CMChildren in the DOM3 CMLS module a bit
> > unclear.  CMChildren is said to be "an element in the context of a
> > CMNode".  On the other hand, the operation
> > ElementDeclaration.getCMChildren() which returns a 
> CMChildren is said to
> > "gets content model of element".  "An element in the 
> context of a CMNode"
> > and "content model of element" do not sound equivalent to me.
> >
The CMElement describes the content model for an element declaration. We
shall see in the following example how it is done. As for the context of a
CMNode, note that each element declarations is a CMNode and hence the term
"in the context of a CMNode" which implies in the context of a CMNode of
type ElementDeclaration.

> > I also have some problem understanding the following attributes of
> CMChildren:
> > - listOperator (whose description is "Operator list") and
> > - subModels (whose description is "Additional CMNodes in 
> which the element
> > can be defined").
> >
> > Any clarification will be appreciated.
> 
> Sorry Ernest, no answer from me. I would just like to say 
> that I am also
> confused by these interfaces. I would like to say to 
> potential answer givers
> that it would be useful to have an example 
> object-representation of the CM
> with e.g. a DTD declaration like
>     <!ELEMENT example (((child1, child2*)*) | child3+)>
> because what kind of hierarchy of list-operators, CMChildren 
> and submodels
> would you get here?
The CMChildren describe the element declaration through a parse tree. The
listOperator and the submodel describes this tree. So the structure for the
above example will look like this:
1. The element declaration for "Example" will point to a CMChildren say
CMCh1.
ElementDeclaration Example= {
  contentType = ELEMENT;
  CMChildren = CMCh1;
  CMNamedNodeMap = EmptyNamedNodeMap; /* no attributes defined */
  CMNamedNodeMap = {child1,child2,child3);
}

2. The structure of CMChildren CMCh1 will be like this.

CMChildren CMCh1 = {
     listOperator = "|";
     elementType = 1; /* string data type */
     multiplicity = 1;
     CMNamedNodeMap={(CMChildren CMCh2)(CMChildren CMCh3)};
     isPCDataOnly = false;
};
 

CMChildren CMCh2 = 
     listOperator = ",";
     elementType = 1; /* string data type */
     multiplicity = 0|many;
     CMNamedNodeMap={(CMChildren CMCh4)(CMChildren CMCh5)};
     isPCDataOnly = false;
};

CMChildren CMCh4 = 
     listOperator = "";
     elementType = 1; /* string data type */
     multiplicity = 1;
     CMNamedNodeMap={(ElementDeclaration child1)};
     isPCDataOnly = false;
};

CMChildren CMCh5 = 
     listOperator = "";
     elementType = 1; /* string data type */
     multiplicity = 0|more;
     CMNamedNodeMap={(ElementDeclaration child2)};
     isPCDataOnly = false;
};

CMChildren CMCh3 = 
     listOperator = "";
     elementType = 1; /* string data type */
     multiplicity = 1|more;
     CMNamedNodeMap={(ElementDeclaration child3)};
     isPCDataOnly = false;
};

Hope this helps. 

> 
> Thanks in advance for helping us out,
> 
> --Sander.
> 
> 
> 
> 

Received on Tuesday, 6 March 2001 14:35:35 UTC