W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2001

problem with the "Structures" DTD in appendix G of part 1; "Struc tures"?

From: Gignac Donald A CRBE <GignacDA@nswccd.navy.mil>
Date: Thu, 24 May 2001 13:51:53 -0400
Message-ID: <1F9F67162ADED3119F18009027A8F404C60449@crbeex03.dt.navy.mil>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Cc: "Garner F J (Joe) CRBE" <GarnerFJ@nswccd.navy.mil>, "Westbrook Evelyn L (Lori) CRBE" <WestbrookEL@nswccd.navy.mil>, Junod L J II CRBE <JunodLJ@nswccd.navy.mil>
Ten schema examples in part 0: "Primer" are not in conformance  with 
the "Structures" DTD in appendix G of part 1: "Structures". They begin
with the following "schema" tags.

	Section 3.1 "Target Namespaces & Unqualified Locals"
"Purchase Order Schema with Target Namespace, po1.xsd "
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1"
        elementFormDefault="unqualified"
        attributeFormDefault="unqualified">

	Section 3.2 "Qualified Locals"
"Modifications to po1.xsd for Qualified Locals" 
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">

"Requiring Qualification of Single Attribute" 
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">

	Section 3.3 "Global vs. Local Declaration"
"Modified version of po1.xsd using only global element declarations" 
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:po="http://www.example.com/PO1"
        targetNamespace="http://www.example.com/PO1">

	Section 4.1 "A Schema in Multiple Documents"
"The International Purchase Order Schema, ipo.xsd"
<schema targetNamespace="http://www.example.com/IPO"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:ipo="http://www.example.com/IPO">

"Addresses for International Purchase Order schema, address.xsd"  
<schema targetNamespace="http://www.example.com/IPO"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:ipo="http://www.example.com/IPO">

	Section 4.5 "Redefining Types & Groups"
"Using redefine in the International Purchase Order" 
<schema targetNamespace="http://www.example.com/IPO"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:ipo="http://www.example.com/IPO">

	Section 4.7 "Abstract Elements & Types"
"Schema for Vehicles" 
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
         targetNamespace="http://cars.example.com/schema" 
         xmlns:target="http://cars.example.com/schema"> 
         
	Section 5 "Advanced Concepts III; The Quarterly Report"
"The Report Schema, report.xsd" 
<schema targetNamespace="http://www.example.com/Report"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:r="http://www.example.com/Report"
        xmlns:xipo="http://www.example.com/IPO"
        elementFormDefault="qualified">

Section 5.4.1 "Type Libraries"
"Example Currency Type in Type Library" 
<schema targetNamespace="http://www.example.com/Currency"
        xmlns:c="http://www.example.com/Currency"
        xmlns="http://www.w3.org/2001/XMLSchema">

In each of these examples, the default name space is

	xmlns="http://www.w3.org/2001/XMLSchema"

and so the "p" parameter entity specifying the prefix is defined as

	<!ENTITY % p "">

For the above examples, the "s" parameter entities specifying the 
suffix are defined as

	<!ENTITY % s ":po">
	<!ENTITY % s ":po">
	<!ENTITY % s ":po">
	<!ENTITY % s ":po">
	<!ENTITY % s ":ipo">
	<!ENTITY % s ":ipo">
	<!ENTITY % s ":ipo">
	<!ENTITY % s ":target">
	<!ENTITY % s ":r">
	<!ENTITY % s ":c">

respectively.

The relevant declarations in the "structures" DTD in appendix G of 
part 1: "Structures" are

	<!ENTITY % nds 'xmlns%s;'>
	
	<!ENTITY % schema "%p;schema">

<!ATTLIST %schema;
   targetNamespace      %URIref;               #IMPLIED
   version              CDATA                  #IMPLIED
   %nds;                %URIref;               #FIXED  'http://www.w3.org/2001/XMLSchema'
   xmlns                CDATA                  #IMPLIED
   finalDefault         %complexDerivationSet; ''
   blockDefault         %blockSet;             ''
   id                   ID                     #IMPLIED
   elementFormDefault   %formValues;           'unqualified'
   attributeFormDefault %formValues;           'unqualified'
   xml:lang             CDATA                  #IMPLIED
   %schemaAttrs;>

The "URIref" parameter entity is defined in the "datatype" DTD in appendix B of 
part 2: "Datatypes as

	<!ENTITY % URIref "CDATA">

For the first example above, the ATTLIST declaration simplifies to

	<!ATTLIST schema  ...
		    xmlns:po	CDATA 	 #FIXED  'http://www.w3.org/2001/XMLSchema''	
		    xmlns	CDATA  #IMPLIED  ... >

This results in a conflict between the "xmlns:po" attribute specification on 
the "schema" tag	

	xmlns:po="http://www.example.com/PO1"

and the attribute's #FIXED default value of  'http://www.w3.org/2001/XMLSchema''. 
There are similar conflicts for the other nine schema examples above.

The simplest solution seems to be that of switching the default value of the 
attribute defined  by "xmlns%s;;"  and that of the "xmlns" attribute in the 
"structures" DTD. That is, redefine	

	%nds;                %URIref;          #FIXED  'http://www.w3.org/2001/XMLSchema'
	xmlns                CDATA             #IMPLIED
as
	%nds;                %URIref;	#IMPLIED               
	xmlns                CDATA		#FIXED  'http://www.w3.org/2001/XMLSchema'                  

Donald Gignac	"gignacda@nswccd.navy.mil"	301-227-3348 
Received on Thursday, 24 May 2001 13:52:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT