Subject: XML model

From: Evangelos Haleplidis <[email-masked]>
Date: Wed, 9 Mar 2005 12:36:44 +0200

Greetings again to the list,

I have read the Model draft (-04 version) and used the XML Spy parser to
have a better view of the XML schema, and found the following typos:

1) Page 64
type="rangeRestrictionType minOccurs="0"/>
--------------------------^
type="rangeRestrictionType" minOccurs="0"/>

2) Page 65
<xsd:element name="keyField" maxOccurs="unbound"
-----------------------------------------------^
<xsd:element name="keyField" maxOccurs="unbounded"

3) Page 65
<!-declare keys to have unique IDs -->
--^
<!--declare keys to have unique IDs -->

4) Page 67
<! - does the above ensure that attributes and capabilities
---^
<!-- does the above ensure that attributes and capabilities

5) Page 67
Two lines down after typo No4, there seems to be missing a closing comment
tag: -->

6) Page 65
The key declarations, for which the comments are as follows, are not
accepted by the XML parser:
a) <!-- declare keys to have unique IDs -->
b) <!-- key declaration to make elementIDs unique in a struct --> In order
for the XML parser to accept the key declarations, they must be moved
inside the element declaration. i.e.

a)
<xsd:element name="key" maxOccurs="unbounded">
	<xsd:complexType>
		<xsd:sequence>
			<xsd:element name="keyField" type="xsd:string" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="keyID" type="xsd:integer" use="required"/>
	</xsd:complexType>
	<!-- declare keys to have unique IDs -->
	<xsd:key name="keyID">
		<xsd:selector xpath="lfb:key"/>
		<xsd:field xpath="@keyID"/>
	</xsd:key>
</xsd:element>

b)
<xsd:element name="element" maxOccurs="unbounded">
	<xsd:complexType>
		<xsd:sequence>
			<xsd:element name="name" type="xsd:NMTOKEN"/>
			<xsd:element ref="synopsis"/>
			<xsd:element name="optional" minOccurs="0"/>
			<xsd:group ref="typeDeclarationGroup"/>
		</xsd:sequence>
		<xsd:attribute name="elementID" type="xsd:integer" use="required"/>
	</xsd:complexType>
	<!-- key declaration to make elementIDs unique in a struct -->
	<xsd:key name="structElementID">
		<xsd:selector xpath="lfb:element"/>
		<xsd:field xpath="@elementID"/>
	</xsd:key>
</xsd:element>

Regards,
Evangelos Haleplidis.

---

From: "Joel M. Halpern" <[email-masked]>
Date: Wed, 9 Mar 2005 09:47:00 -0500

Thanks for the careful review.
Getting the key declarations right has been "interesting".  I think you are 
right about where they go, but I am not sure that has the right 
meaning.  The problem may be the selector rather than the placement.  I 
have to work with this.  (And probably construct several LFB definitions to 
verify against the schema to make sure it means the right thing.)

Yours,
Joel