W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2005

RE: Versioning of XML Schema and namespaces

From: <John.Hockaday@ga.gov.au>
Date: Tue, 10 May 2005 17:12:20 +1000
Message-ID: <158ADDBA43E6C748BBD230A469EC6A4D0F003B@mail.ga.gov.au>
To: <xmlschema-dev@w3.org>

Hi all,

I am now more confused.  Should an XML document instance have a namespace?  I
thought Eliot indicated that I should be using schemaLocation?  What should
an XML document instance that tells you what XSD to validate it against look
like?  I guess it must start with an XML declaration:

<?xml version="1.0" encoding="UTF-8"?>
then a nameSpace or schemaLocation to tell everyone what XSD it should comply
to:
then the root element:
<root>
 <all the other elements, attributes and values that suit the XSD />
</root>

Does it have to identify every XSD that it uses?  Even those that are
imported by the child XSD that is used for this XML document instance?
Doesn't the "import" element in the child cater for that?  If I need to
include a namespace statement for every single XSD that it references that
that will take up many lines.

Sorry for this confusion.  The old DOCTYPE was easier to understand.


John

> -----Original Message-----
> From: Michael Kay [mailto:mike@saxonica.com] 
> Sent: Monday, 9 May 2005 6:10 PM
> To: Hockaday John; xmlschema-dev@w3.org
> Cc: ":www-xml-schema-comments"@w3.org
> Subject: RE: Versioning of XML Schema and namespaces
> 
> 
> Personally I think the combination of a namespace and a 
> version attribute in
> the document element is a better way of asserting conformance to a
> particular version of an external standard than use of a 
> schemaLocation. The
> reason for that is that the semantics of xsi:schemaLocation 
> as defined in
> the XML Schema specification don't say it's an assertion 
> about conformance,
> they say it's a hint about where to find a schema to use for 
> validation.  I
> think it's a mistake to overlay different semantics onto an attribute
> outside your control; and more practically, using this attribute as a
> conformance assertion prevents people using it to point to a 
> local copy of a
> schema.
> 
> Michael Kay
> http://www.saxonica.com/ 
> 
> > -----Original Message-----
> > From: John.Hockaday@ga.gov.au [mailto:John.Hockaday@ga.gov.au] 
> > Sent: 09 May 2005 01:24
> > To: mike@saxonica.com; xmlschema-dev@w3.org
> > Cc: ":www-xml-schema-comments"@w3.org
> > Subject: RE: Versioning of XML Schema and namespaces
> > 
> > Michael,
> > 
> > Thanks for your comments.  Please see below one aspect that I 
> > disagree with.
> > 
> > Thanks to you all for being patient and contributing to this 
> > discussion.
> > 
> > 
> > John
> > 
> > > -----Original Message-----
> > > From: Michael Kay [mailto:mike@saxonica.com] 
> > > Sent: Friday, 6 May 2005 8:26 PM
> > > To: Hockaday John; xmlschema-dev@w3.org
> > > Cc: ":www-xml-schema-comments"@w3.org
> > > Subject: RE: Versioning of XML Schema and namespaces
> > > 
> > > 
> > > ....
> > > 
> > > I wouldn't expect the instance document to contain a 
> schemaLocation
> > > attribute, or if it does, I wouldn't expect a recipient to 
> > > trust it when
> > > doing validation. If say the sender has decided to leave out 
> > > some mandatory
> > > elements, and to create a local copy of the schema that makes 
> > > them optional,
> > > you as the recipient don't want validation to succeed.
> > > 
> > 
> > The metadata gateway that I manage will be able to search 
> metadata of
> > multiple types.  For example; 
> > ANZLIC version 2 defined by 
> > http://www.environment.gov.au/net/dtd/anzmeta-1.3.dtd , 
> > extensions to this standard such as 
> > http://www.indexgeo.net/dtd/anzmeta-resource-v11.dtd and
> > http://www.gso.qld.gov.au/qsiis/dtd/qsiis-1.3.dtd 
> > or ISO 19139 metadata records including extensions of that 
> > standard, which
> > are yet to be defined.
> > 
> > If I download an XML metadata record (document instance) I 
> > don't know what
> > standard I should validate it against unless there is a DOCTYPE or
> > schemaLocation declaration.  I therefore can't validate that 
> > document without
> > this information.  I believe that *every* XML document 
> > instance should have
> > either a DOCTYPE or a schemaLocation so that anyone who wants 
> > to look at this
> > instance knows with what XSD it complies.  One may not wish 
> > to validate the
> > document but if one wants to use the document then he or she 
> > needs to know
> > what this document is about.  That can only be rigorously 
> > identified by a
> > DOCTYPE or schemaLocation declaration.
> > 
> > Furthermore, I agree that if a "mandatory" element in an 
> > extension of the ISO
> > 19139 metadata standard has been redefined as "optional" then 
> > validation
> > should ignore that change. However, by definition of the 
> > extensibility of the
> > ISO 19115 metadata standard, an "optional" ISO 19139 element 
> > can be made
> > "mandatory" in an extension of that XSD for an organisation's 
> > or country's
> > need.  Therefore, one *must* use that extension when 
> validating an XML
> > document instance of that XSD type to check that it meets 
> > those needs.  The
> > only way I know of to identify that extension is from a 
> schemaLocation
> > declaration and therefore is it necessary to validate that 
> > XML document
> > instance.
> > 
> > Public identifiers were great.  There was only the need for 
> > one DOCTYPE
> > declaration in an XML document instance.  It was the 
> inclusion of the
> > original DTD in the DTD identified by the DOCTYPE that 
> > defined the extension.
> > It wasn't necessary to have the original DTD identified in 
> > the XML document
> > instance.
> > 
> > However, and I'm not sure about this, it seems that if one 
> > extends a W3C XML
> > Schema then one needs to not only identify the new XSD via a 
> > namespace but
> > one also needs to include the original XSD that has been 
> > extended.  If this
> > is so then XML document instances can become *very* messy 
> > when there is an
> > extension of an extension of an extension etc..  
> > 
> > Thanks for your time.
> > 
> > J.H.
> > 
> > > Michael Kay
> > > http://www.saxonica.com/
> > > 
> > > 
> > > 
> > 
> 
> 
> 
Received on Tuesday, 10 May 2005 07:12:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:50 GMT