|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Questions on DCD
> -----Original Message----- > From: Maneesha Jain [mailto:Maneesha.Jain@E...] > Sent: Tuesday, January 19, 1999 4:34 PM > To: petsa@u...; xml-dev@i...; tbray@t...; Charles > Frankston > Cc: Maneesha.Jain@E... > 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"> <Element>A</Element> </ElementDef> 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"/> <ElementDef> 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"/> <ElementDef> 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@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








