[Bug 4639] Allow cycle checking on element graphs as well as document graphs

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4639





------- Comment #15 from virginia.smith@hp.com  2007-11-29 00:06 -------
Based on further discussions with Sandy, Kumar, and myself, the following
proposal revision removes the necessity for one of the 2 options in comment
#13. Essentially, this means that SML references are the arcs in the directed
graph, targets of the references are the arc target nodes in the graph, and all
ancestors of a reference are the source nodes of the arcs. 

The following is a further refinement of the proposal (replaces comment #11).
Note that the section numbers are updated to reflect the current spec (editors'
copy):
=================

1. Replace section 4.4.1 with the following text.
------------------------------
sml:acyclic is used to specify that a cycle is not allowed for an SML reference
type. Model validators that conform to this specification MUST support the
sml:acyclic attribute on any <xs:complexType> element in a schema document.
This is a boolean attribute and its value can be either true or false.
------------------------------

2. Replace section 4.4.1.3 with the following text.
------------------------------
If CT is a complex type definition with {acyclic} true, then instances of CT
MUST NOT create cycles in the model. More precisely, the directed graph
constructed in the following way MUST be acyclic:

1. The nodes in the graph are all the elements resolved to by SML references of
type CT or types derived from CT.

2. If a node N is or contains an SML reference R of type CT or a type derived
from CT, and R resolves to T (which must also be a node in the graph), then an
arc is drawn from N to T.
-------------------------------

3. Replace section 8.1.1 with the following text.
-------------------------------
8.1.1 sml:acyclic 

Used to specify that instances of an SML reference of a given type and its
derived types does not create any cycles in a model.

If this attribute is set to true for a complex type D, then instances of D
(including any derived types of D) that are SML references cannot create any
cycles in a model. In the following example, HostedOnRefType is a complex type
declaration whose instances cannot create a cycle:

<xs:complexType name="HostedOnRefType" sml:acyclic="true">

...

</xs:complexType>

If the sml:acyclic attribute is not specified or set to false for a complex
type declaration ration, then instances of this type that are SML references
may create cycles in a model.
-------------------------------

Received on Thursday, 29 November 2007 00:07:04 UTC