Index: content-models.xml =================================================================== RCS file: /w3ccvs/WWW/DOM/Group/drafts/level-3-src/xml/cm-ls/content-models.xml,v retrieving revision 1.19 retrieving revision 1.35 diff -r1.19 -r1.35 2c2 < --- > 11c11 <
Content Models and Validation --- > Content Models and Validation 28c28 < EARLY DRAFT! Last known edit 02/02/2001 --- > EARLY DRAFT! Last known edit 04/11/2001 30c30 < proposed revisions already marked up as per spec.dtd! --- > proposed revisions already marked up as per spec.dtd! 35c35 < | OVERVIEW | --- > | OVERVIEW | 46,50c46,48 < including Namespace well-formedness. A DOM application can use the <hasFeature
method of theDOMImplementation
interface
< to determine whether a given DOM supports these capabilities or not. One
< feature string for the CM-editing interfaces listed in this section is
< "CM-EDIT" and another feature string for document-editing interfaces is
---
> including Namespace well-formedness. A DOM application can use the hasFeature
method of theDOMImplementation
interface to determine whether a given DOM supports these capabilities
> or not. One feature string for the CM-editing interfaces listed in this section
> is "CM-EDIT" and another feature string for document-editing interfaces is
128c126,127
< CR5. Associate a CM with a document and make it the active CM.
--- >CR5. Associate a CM with a document and make it the active CM.
> 231,236c230,231 < the former will report the element'sQName
, e.g.,
< foo:bar
, whereas the latter will report its namespace and local
< name, e.g., {http://my.namespace}bar
. We have added the
< isNamespaceAware
attribute to the generic CM object to help
< applications determine which of these fields are important, but we are still
< analyzing this challenge.
---
> the former will report the element's QName
, e.g., foo:bar
, whereas the latter will report its namespace and local name, e.g., {http://my.namespace}bar
. We have added the isNamespaceAware
attribute to the generic CM object to help applications determine which
> of these fields are important, but we are still analyzing this challenge.
274c269,270
< follow, starting off with the data structures and "CM-editing" methods. 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, that has both an internal and external subset. The internal subset
< would always exist, even if empty, with the external subset (if present) being
< represented as a link to one or more CMExternalModel
s. It is
< possible, however, that none of these CMExternalModel
s are
< active.
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, that has both an
> internal and external subset. The internal subset would always exist, even if
> empty, with the external subset (if present) being represented as by an
> "active" CMExternalModel
. Many CMExternalModel
s could exist, but only one can be specified as "active"; it is also
> possible that none are "active". The issue of multiple content models is
> misleading since in this architecture, only one CMModel
exists, with an internal subset that references the external subset. If
> the external subset changes to another "acitve" CMExternalModel
, the internal subset is "fixed up." The CMModel also contains the
> factory methods needed to create a various types of CMNodes like CMElementDeclaration
, CMAttributeDeclaration
, etc.
QNames
.
---
> terms of namespaces and local names; false if the document structure is defined
> only in terms of QNames
.
299,300c297,298
< The root element declaration for the content model.
--- >The root element declaration for the content model. Although a > root element is specified in the document instance, when a content model is > generated, a user should be able to chose the root element for editing purpose. > This is just a placeholder for that element. It could also be null. For > validating an XML document, root element must be defined in its active content > model. CMModel.rootElementDecl provides access to that root element > declaration. This recommendation does not say how to fill in the > rootElementdecl. It could be manually done by the user before validating a > document, in some cases where possible, the CMModle loader may be able to fill > it in etc.
306,307c313,314 <Location of the document describing the content model < defined in this CMModel.
--- >Location of the document describing the content model defined in > this CMModel.
313,314c320,321 <This method returns a DOMString defining the absolute < location from which this document is retrieved including the document name.
--- >This method returns a DOMString defining the absolute location > from which this document is retrieved including the document name.
319c326 < --- > 337,338c344 <Returns CMNode
list of all the constituent
< nodes in the content model.
Returns CMNode
list of all the constituent nodes in the content model.
Creates an element declaration for the element type specified. > The returned object implements CMElementDeclaration interface.
>The qualified name of the element type being declared.
>Constant for MIXED, EMPTY, ANY and CHILDREN.
> >A new CMElementDeclaration object with name
attribute set to qualifiedElementName and the contentType
set to contentSpec. Other attributes of the element declaration are set
> through CMElementDeclaration interface methods.
INVALID_CHARACTER_ERR: Raised if the specified name contains > an illegal character.
>DUPLICATE_NAME_ERR:Raised if an element declaration already > exists with the same name for a given CMModel.
>Creates an attribute declaration. The returned object implements > CMAttributeDeclaration interface.
>The name of the attribute being declared.
>A new CMAttributeDeclaration object with attributeName
attribute set to input qualifiedname parameter.
INVALID_CHARACTER_ERR: Raised if the specified name contains > an illegal character.
>Creates a new notation declaration. The returned object > implements CMNotationDeclaration interface.
>The name of the notation being declared.
>The system identifier for the notation declaration.
>The public identifier for the notation declaraiton.
>A new CMNotationDeclaration object with notationName
attribute set to name.
INVALID_CHARACTER_ERR: Raised if the specified name contains > an illegal character.
>DUPLICATE_NAME_ERR:Raised if a notation declaration already > exists with the same name for a given CMModel.
>Creates a new entity declaration. The returned object implements > CMEntityDeclaration interface.
>The name of the entity being declared.
>A new CMNotationDeclaration object with entityName
attribute set to name.
INVALID_CHARACTER_ERR: Raised if the specified name contains > an illegal character.
>Creates a new CMChildren object. The subModels of the CMChildren > is build using CMChildren interface methods.
>The minimum occurance for the subModels of this > CMChildren.
>The maximum occurance for the subModels of this > CMChildren.
>operator of type CHOICE, SEQ or NONE
>A new CMChildren object.
>INVALID_CHARACTER_ERR: Raised if the specified name contains > an illegal character.
>CMExternalModel
is an abstract object that could
< map to a DTD, an XML Schema, a database schema, etc. It's a generalized content
< model object that is not bound to a particular XML document.
CMExternalModel
is an abstract object that could map to a DTD, an XML Schema, a
> database schema, etc. It's a generalized content model object that is not bound
> to a particular XML document.
CMNode
is analogous to a
< Node
in the Core DOM, e.g., an element declaration. This can exist
< for both CMExternalModel
(include/ignore must be handled here) and
< CMModel
. It should handle the following:
interface CommentsPIsDeclaration { attribute
< ProcessingInstruction pis; attribute Comment comments; }; interface Conditional
< Declaration { attribute boolean includeIgnore; };
Opaque.
< <The node is an ElementDeclaration
.
The node is an AttributeDeclaration
.
The node is a CMNotationDeclaration
.
The node is an EntityDeclaration
.
CMNode
is analogous to a Node
in the Core DOM, e.g., an element declaration. This can exist for both CMExternalModel
and CMModel
. It should be able to handle constructs such as comments and processing
> instructions.
Opaque.
>The node is an CMElementDeclaration
.
The node is an CMAttributeDeclaration
.
The node is a CMNotationDeclaration
.
The node is an CMEntityDeclaration
.
The node is a CMChildren
.
The node is a CMModel
.
The node is a CMChildren
.
The node is a CMModel
.
The node is a CMExternalModel
.
The node is a CMExternalModel
.
A code representing the underlying object as defined above.
<Creates a copy of CMModel
. No document refers
< to the CMNode
returned.
Cloned CMNode
.
A code representing the underlying object as defined above.
>The CMModel
object associated with this CMNode. For a node of type CM_MODEL
, this is null
.
The qualified name
of this CMNode depending on the CMNode type.
The namespace prefix of this node, or null if it is > unspecified.
>Returns the local part of the qualified name
of this CMNode.
Creates a copy of CMExternalModel
. It is
< possible that a document would not refer to the CMNode
< returned.
The namespace URI of this node, or null if it is > unspecified.
>Creates a copy of CMNode
.
CMNamedNodeMap
.
---
> NodeList; the document order is meaningful, as opposed to CMNamedNodeMap
.
541c692,693
< The primitive datatypes supported currently are:
< string
, boolean
, float
,
< double
, decimal
.
The primitive datatypes supported by base DOM CM implementation
> is: string
type only.
code representing the string
data
< type as defined in
code representing the string
data type as defined in
>
Returns one of the enumerated code representing the primitive > data type.
>code representing the primitive type of the attached data > item.
>The primitive types supported by optional DOM CM > implelementations. A DOM application can use the hasFeature method of the > DOMImplementation interface to determine whether this interface is supported or > not. The feature string for all the interfaces listed in this section is > "CMPTYPES" and the version is "3.0".
>code representing the boolean
data
< type as defined in
code representing the boolean
data type as defined in
>
code representing the float
data
< type as defined in
code representing the float
data type as defined in
>
code representing the double
data
< type as defined in
code representing the double
data type as defined in
>
code representing a long data type as defined in
code representing an integer
data
< type as defined in
code representing a short data type as defined in
code representing a byte data type as defined in
code representing a decimal
data type as defined in
>
code representing a hexbinary
data type as defined in
>
code representing a base64binary
data type as defined in
>
code representing an uri reference
data type as defined in
> XML Schema
> Datatypes.
@@uriReference is no longer part of the XML Schema PR draft.
>code representing an XML qualified name
data type as defined in
>
code representing a duration
data type as defined in
>
code representing adatetime
data type as defined in
>
code representing adate
data type as defined in
>
code representing a time
data type as defined in
>
code representing a yearmonth
data type as defined in
>
code representing a year
data type as defined in
>
code representing a monthday
data type as defined in
>
code representing a day
data type as defined in
>
code representing a month
data type as defined in
>
code representing aNOTATION
data type as defined in
>
The low value for a primitive DECIMAL_DATATYPE in the value > range.
598c848 <The high value for a primitive DECIMAL_DATATYPE in the value > range.
604,620c855 <Returns one of the enumerated code representing the < primitive data type.
<code representing the primitive type of the attached data < item.
<CMNode
.
---
> context of a CMNode
.
632a868,886
> Datatype of the element.
>Boolean defining whether the element type contains child > elements and PCDATA or PCDATA only for mixed element types. True if the element > is of type PCDATA only. Relevant only for mixed content type elements.
>tagName of the element being declared.
>Gets content type, e.g., empty, any, mixed, elements, < PCDATA, of an element.
--- >Gets content type, e.g., empty, any, mixed, elements, PCDATA, of > an element.
667,669c921 <Returns a CMNamedNodeMap
containing
< AttributeDeclarations
for all the attributes that can appear on
< this type of element.
Returns a CMNamedNodeMap
containing CMAttributeDeclarations
for all the attributes that can appear on this type of element.
Returns a CMNamedNodeMap
containing
< ElementDeclarations
for all the Element
s that can
< appear as children of this type of element. Note that which ones can actually
< appear, and in what order, is defined by the CMChildren
.
Returns a CMNamedNodeMap
containing CMElementDeclarations
for all the Element
s that can appear as children of this type of element. Note that which
> ones can actually appear, and in what order, is defined by the CMChildren
.
An element in the context of a CMNode
.
The content model of a declared element.
710,711c961,968 <Signifies unbounded upper limit. The MAX_LONG value is the > maximum value of an unsigned long integer for a given language binding.
>Operator list.
--- >No operators defined on the subModels
. This is usually the case where the subModels contain a single element
> declaration.
This constant value signifies a sequence operator ",".
>This constant value signifies a choice operator "|".
>One of CHOICE or SEQUENCE. The operator is applied to all the
> components(CMNodes) in the the subModels
. For example, if the list operator is CHOICE and the components in
> subModels are a, b and c then the content model for the element being declared
> is (a|b|c)
Datatype of the element.
--- >min occurrence for this content particle. Valid values are from > 0 to UNBOUNDED.
722,723c998,1004 <maximum occurrence for this content particle. Valid values are > from 0 to UNBOUNDED.
>0 or 1 or many.
--- >Additional CMNode
s in which the element can be defined.
Additional CMNode
s in which the element can be
< defined.
Removes the CMNode at the indicated index position in the > submodel.
734,736c1015,1028 <Index of the node being removed.
>The node removed is returned as a result of this method call.
> The method returns null
if the index is outside the bounds of the subModels
list.
Boolean defining whether the element type contains child
< elements and PCDATA or PCDATA only for mixed element types. True if the element
< is of type PCDATA only. Relevant only for mixed content type elements.
<
Inserts a new node at a position in the submodel referred to by > the nodeIndex. Node already exisiting in the list is moved as needed.
744c1033,1065 < --- >The position of where the newNode is inserted.
>The new node to be inserted.
>The index value at which it is inserted. If the nodeIndex is
> outside the bound of the subModels
list, the item is inserted at the back of the list.
Appends a new node to the end of the list representing thesubModels
.
The new node to be appended.
>the length of the subModels
.
An attribute in the context of a CMNode
.
An attribute declaration in the context of a CMNode
.
Name of the attribute.
806c1125,1126 <As in current DOM.
--- >Models a general entity declaration in a content model.
>
constant defining an internal entity.
>constant defining an external entity.
>One of the INTERNAL_ENTITY or EXTERNAL_ENTITY.
>The name of the declared general entity.
>The replacement text for the internal entity. The entity
> references within the replacement text is kept intact. For entity of type
> EXTERNAL_ENTITY this is null
.
The system identifier associated with the entity, if specified.
> If the system identifier was not specified, this is null
.
The public identifier associated with the entity, if specified.
> If the public identifier was not specified, this is null
.
For unparsed entities, the name of the notation declaration for
> the entity. For parsed entities, this is null
.
The name of this notation declaration.
>The string representing the public identifier for this < notation declaration.
<The string representing the public identifier for this notation > declaration.
>This section contains "Validation and Other" methods common to both
< the document-editing and CM-editing worlds (includes Document
,
< DOMImplementation
, and DOMErrorHandler
methods).
This section contains "Validation and Other" methods common to both the
> document-editing and CM-editing worlds (includes Document
, DOMImplementation
, and DOMErrorHandler
methods).
The setErrorHandler
method is off of the
< Document
interface.
The setErrorHandler
method is off of the Document
interface.
Allow an application to register an error event handler. <
--- >Allow an application to register an error event handler.
885,886c1252,1253 <This interface extends the Document
interface
< with additional methods for both document and CM editing.
This interface extends the Document
interface with additional methods for both document and CM editing.
Check for well-formedness of the document.
>Check for namespace well-formedness includes WF_CHECK.
>Checks for whether the document is partially valid. It includes > NS_WF_CHECK. >
>
>
Checks for strict validity of the document with respect to > active CM which by defiition includes NS_WF_CHECK.
>An attribute specifying whether continuous checking for the > validity of the document is enforced or not. When set to true the > implementation is free to raise the VALIDATION_ERR exception on DOM operations > that would make the document invalid with respect to "partial validity". This > attribute is false by default.
>This attribute defines the level at which the validity and
> welformedness testing is done by the isValid
method.
Determines number of CMExternalModel
s
< associated with the document. Only one CMModel
can be associated
< with the document, but it may point to a list of
< CMExternalModel
s.
Determines number of CMExternalModel
s associated with the document. Only one CMModel
can be associated with the document, but it may point to a list of CMExternalModel
s.
Find the sole CMModel
of a document. Only one
< CMModel
may be associated with the document.
Find the sole CMModel
of a document. Only one CMModel
may be associated with the document.
Obtains a list of CMExternalModel
s associated
< with a document from the CMModel
. This list arises when
< addCM()
is invoked.
Obtains list of CMNodes
of typeCM_EXTERNALMODEL
s associated with the document.This list arises when addCM()
is invoked.
A list of CMExternalModel
s associated with a
< document.
A list of CMExternalModel
s associated with a document.
Find the active CMExternalModel
for a
< document.
Find the active CMExternalModel
for a document.
CMModel
with a pointer to the active
< CMExternalModel
of document.
CMModel
with a pointer to the active CMExternalModel
of document.
Associate a CMModel
with a document. Can be
< invoked multiple times to result in a list of CMExternalModel
s.
< Note that only one sole internal CMModel
is associated with the
< document, however, and that only one of the possible list of
< CMExternalModel
s is active at any one time.
Associate a CMModel
with a document. Can be invoked multiple times to result in a list of CMExternalModel
s. Note that only one sole internal CMModel
is associated with the document, however, and that only one of the
> possible list of CMExternalModel
s is active at any one time.
Removes a CM associated with a document; actually removes a
< CMExternalModel
. Can be invoked multiple times to remove a number
< of these in the list of CMExternalModel
s.
Removes a CM associated with a document; actually removes a CMExternalModel
. Can be invoked multiple times to remove a number of these in the list
> of CMExternalModel
s.
Make the given CMModel
active. Note that if a
< user wants to activate one CM to get default attribute values and then activate
< another to do validation, a user can do that; however, only one CM is active at
< a time.
Make the given CMModel
active. Note that if a user wants to activate one CM to get default
> attribute values and then activate another to do validation, a user can do
> that; however, only one CM is active at a time. In case where an attribute is
> declared in an internal subset and corresponding ownerElement
points to CMElementDeclaration
defined in an external subset, changing active CM will cause the ownerElement
to be re-computed. If the owner element is not defined in the newly
> active CM, the ownerElement
will be an empty node list.
CM to be active for the document. The
< CMModel
points to a list of CMExternalModel
s; with
< this call, only the specified CM will be active.
CM to be active for the document. The CMModel
points to a list of CMExternalModel
s; with this call, only the specified CM will be active.
True if the CMModel
has already been
< associated with the document using addCM()
; false if not.
True if the CMModel
has already been associated with the document using addCM()
; false if not.
This interface extends the DOMImplementation
< interface with additional methods.
This interface extends the DOMImplementation
interface with additional methods.
This section contains "Document-editing" methods (includes
< Node
, Element
, Text
and
< Document
methods).
This section contains "Document-editing" methods (includes Node
, Element
, Text
and Document
methods).
This interface extends the Node
interface with
< additional methods for guided document editing.
This interface extends the Node
interface with additional methods for guided document editing.
Determines whether the Node::InsertBefore
< operation would make this document invalid with respect to the currently active
< CM. ISSUE: Describe "valid" when referring to partially completed
< documents.
Determines whether the Node::InsertBefore
operation would make this document invalid with respect to the
> currently active CM. ISSUE: Describe "valid" when referring to partially
> completed documents.
A boolean that is true if the
< Node::InsertBefore
operation is allowed.
A boolean that is true if the Node::InsertBefore
operation is allowed.
True if the node is valid in the current context, false if < not.
--- >True if the node is valid/well-formed in the current context > and check level defined by wfValidityCheckLevel, false if not.
1206c1600,1605 < --- >NO_CM_AVAILABLE: Exception is raised if the DocumentCM > related to this node does not have any activeCM and wfValidityCheckLevel is set > to STRICT_VALIDITY_CHECK.
>Element
interface with
< additional methods for guided document editing.
---
> This interface extends the Element
interface with additional methods for guided document editing.
ElementDeclaration object
--- >CMElementDeclaration object
1258c1656 <Sets value for specified attribute.
--- >Determines if the value for specified attribute can be set.
1274c1672 <Success or failure.
--- >true or false.
1283c1681 <Determines if attribute can be set.
--- >Determines if attribute node can be added.
1288,1289c1686 <Node
in which the attribute can possibly be
< set.
Node
in which the attribute can possibly be set.
Determines if namespace of attribute's node can be set.
--- >Determines if the attribute node with the given namespace can be > added.
1309,1310c1707,1736 <Attribute's Node
in which to set the
< namespace.
The Attr
to be added to the attribute list.
Success or failure.
>Determines if the attribute with given namespace and local name
> can be created if not already present in the attribute list of the element. If
> the attribute with same local name and namespaceURI is already present in the
> elements attribute list it sets the value of the attribute and its prefix to
> the new value. See DOM core setAttributeNS
.
Name of attribute.
>Value to be assigned to the attribute.
1332,1333c1758,1759 <Determines if namespace of attribute can be set.
--- >Verifies if an attribute by the given name can be removed.
1343c1769,1785 < --- >true or false.
>Verifies if an attribute by the given name and namespace can be > removed.
>Value to be assigned to the attribute.
--- >Qualified name of the attribute to be removed.
1348c1790 < --- > 1350c1792 <namespaceURI
of namespace.
The namespace URI of the attribute to remove.
1353c1795,1810 < --- >true or false.
>Determines if an attribute node can be removed.
>localName
of namespace.
The Attr
node to remove from the attribute list.
Success or failure.
--- >true or false.
1373c1830 <CharacterData
< interface with additional methods for document editing.
---
> This interface extends the CharacterData
interface with additional methods for document editing.
True if content only whitespace; false for non-whitespace < if it is a text node in element content.
--- >True if content only whitespace; false for non-whitespace if > it is a text node in element content.
1551c2007 <DocumentType
interface
< with additional methods for document editing.
---
> This interface extends the DocumentType
interface with additional methods for document editing.
Determines if this element is defined in the currently < active CM.
--- >Determines if this element is defined in the currently active > CM.
1581c2036 < currently active CM. --- > currently active CM. 1611,1612c2066,2067 <Determines if this attribute is defined for this element in < the currently active CM.
--- >Determines if this attribute is defined for this element in the > currently active CM.
1617c2072 <Name of element.
--- >Name of the element.
1622c2077 <Name of attribute.
--- >Name of the attribute.
1638c2093 < currently active CM. --- > currently active CM. 1674,1676c2129,2131 < complete list of defined elements and for a particular element type, the < complete list of defined attributes. These two methods might return a list of < strings which is a type not yet described in the DOM spec. --- > complete list of defined elements and for a particular element type, the > complete list of defined attributes. These two methods might return a list of > strings which is a type not yet described in the DOM spec. 1699c2154,2155 <This interface extends Attr
to provide guided
< editing of an XML document.
This interface extends Attr
to provide guided editing of an XML document.
returns the corresponding attribute declaration in the < content model.
--- >returns the corresponding attribute declaration in the content > model.
1712c2167 <The attribute declaration corresponding to this < attribute
--- >The attribute declaration corresponding to this attribute
1723,1724c2177,2178 <Returns the notation declaration for the attributes defined < of type NOTATION.
--- >Returns the notation declaration for the attributes defined of > type NOTATION.
1731c2185 < type is of notation type, null otherwise. --- > type is of notation type, null otherwise. 1746c2200,2201 <This section contains DOM error handling interfaces.