Re: New draft: DOM Content Models and Load and Save

> This new version has the first bits of the Load and Save API.
> Lots of work/thoughts in the Content Models (with the help
> of the XML Schema WG).
>
> http://www.w3.org/TR/2001/WD-DOM-Level-3-CMLS-20010209/

Hi there,

I have read the CM draft specification and am confused by some of it,
especially by the attribute data types.

The way I read the spec the specified interface is supposed to be the
abstract super-model to be subclassed for DTDs and Schema's (e.g. "CMModel
is an abstract object that could map to a DTD, an XML Schema, a database
schema, etc. It's a generalized content model object,..."). However,
CMDataType (used in AttributeDeclaration) specifies several primitive types,
such as integer, byte and boolean, which cannot be represented in DTDs. And
these declarations are insufficient for XML-Schema's, these would have to
extend the set drastically. So the generic content model is too specific for
DTDs and too generic for XML-Schema's it seems to me?

AttributeDeclaration seems to be completely targeted to what DTDs support,
e.g. enumAttr seems to be more something for CMDataType to me. Likewise, the
multiplicity attribute of CMChildren can only be 0, 1, or many, like in
DTDs. Why confine it to these values, when XML-schema's can also constrain
to  values like 2 3 18 etc. The XML-schema specific interface would have to
add an extra multiplicity method, because the standard one does not allow
multiplicity to be 4.

NodeCM has all these nice canDoSomething(Node...) methods. I wonder why
AttributeCM has no such methods. I mean, something like
     boolean matchesType(String value)
in which you could pass a potential value, and the content-model tells you
whether that string of characters matches e.g. an integer or is in the
possible value enumeration or whatever type someone has specified for the
attribute in a specific content model. It seems to me that it is desirable
that a programmer's implementation does not have to change much if you move
from DTDs to Schemas for example, but this is not listed as a requirement in
the spec (or is it?). If this is not the case, why a generic model in the
first place?


I hope somebody can explain the logic of it all to me, now that I have tried
to express my confusion?

--Sander.

Received on Monday, 12 February 2001 11:53:08 UTC