Questions on DCD

Charles Frankston cfranks at
Wed Jan 20 01:35:24 GMT 1999

> -----Original Message-----
> From: Maneesha Jain [mailto:Maneesha.Jain at Ebay.Sun.COM]
> Sent: Tuesday, January 19, 1999 4:34 PM
> To: petsa at; xml-dev at; tbray at; Charles
> Frankston
> Cc: Maneesha.Jain at Ebay.Sun.COM
> Subject: Questions on DCD
> Hi,
> I have following questions on DCD. Any help would be a great help.
> 1) 
> If I define an ElementDef type "A", and then a ElementDef type "B"
> which could contain two elements/members of type A. How do I 
> define that ?

By inheritance (defined in Appendix B of DCD).  But even there you don't get
to pick arbitrary members of type A.  If B inherits from A, it inherits the
entire content model.  B may extend A's content model, but not remove things
from it.

> Can I do the following:
> <ElementDef Type="A">
> 	<Element>foo</Element>
> </ElementDef>
> <ElementDef Type="B">
> 	<Element> Ist</Element>   (first member of type A)
> 	<Element> Second</Element>	(second member of type A)
> </ElementDef>
> <ElementDef Type="Ist" Model="Data" Datatype="A"/>
> <ElementDef Type="2nd" Model="Data" Datatype="A"/>
> Or is the value of attribute "Datatype" reserved to what is 
> defined in the spec 
> ?

The meaning of Datatype is as defined in the spec.  Although there are
sensible ways to think about extending this concept to user defined
datatypes, DCD does not do so.

There are three distinct concepts in DCD: use or reference, inheritance (in
the appendix at least), and datatypes.  You are mushing them all together.

An ElementDef is not a means for defining a "datatype", it is the means for
defining the content model of an XML tag.  The value of the Element property
must match the value of the "Type" property of some ElementDef.  So:

  <ElementDef Type="A" Model="Data"/>

  <ElementDef Type="B" Model="Elements" Content="Closed">

means that <B><A>some text</A></B> is legal.  <B>some text</B> is not.  By
contrast inheritance gives us:

  <ElementDef Type="A" Model="Data"/>

  <ElementDef Type="B" Model="Mixed" Content="Closed">
     <Extends Type="A"/>

which means that <B>some text</B> is legal.  <B><A>some text</A></B> is not
because <B> doesn't identify any elements that it may contain.

> 2) Wish <Element> could allow <Description> just like 
> <ElementDef>. Is it 
> possible ?

Lacking a precise DTD, it is hard to say whether DCD allows this or not.

There is no question 3.

> 4) What is the syntax for defining multiple inheritance ?

  <ElementDef Type="B" Model="Mixed" Content="Closed">
     <Extends Type="A"/>
     <Extends Type="C"/>

The content model of "B" is simply the concatenation of the content models
of "A" and "C".

> 5) Where is the DTD for DCD ?

No DTD was written for DCD.  It would be messy to do so because per RDF
rules, properties may be either attributes or element values.

> 6) Is there any site containing couple of examples for defining DCDs ?

None that I know of aside from what's in the paper, perhaps one of the other
authors knows of some.

> Regards,
> Maneesha

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list