[auscope-geosciml] Fw: XMLSpy refuses to validate GeoSciML instance documents ISSUE=33916 PROJ=9

Bruce.Simons at dpi.vic.gov.au Bruce.Simons at dpi.vic.gov.au
Mon May 16 19:17:16 EDT 2011


Response to Marcus' comments from Altova below.
Altova believe they are strictly following the specifications and our 
schema are at fault.

Whether Altova are correct or not I believe we should clean up the 
GeoSciML schema so that they work in XMLSpy from the canonical source 
rather than local catalogs.

I am unable to prepare any Testbed 4 instances until I can get XMLSpy to 
work with GeoSciML v3.

----------------------------------------------------
Bruce Simons
Senior Information Geoscientist
IUGS-Commission for Geoscience Information Oceania Councillor
GeoScience Victoria/Australian Spatial Research Data Commons
Level 9, 55 Collins St
PO Box 4440
Melbourne, Victoria, 3001
Australia

Ph: +61-3-9658 4502
Fax: +61-3-9658 4555
Mobile: +61 429 177155
----- Forwarded by Bruce Simons/DPI/VICGOV1 on 17/05/2011 09:04 AM -----

From:   Altova Technical Support Team <afpsup at altova.com>
To:     Bruce.Simons at dpi.vic.gov.au
Date:   17/05/2011 01:52 AM
Subject:        XMLSpy refuses to validate GeoSciML instance documents 
ISSUE=33916 PROJ=9



When replying, type your text above this line.
----------------------------------------------
Case # :       33916
Submitted on:  2011-05-16 01:58:46

First Name:    Bruce 
Last Name:     Simons
Company:       GeoScience Victoria
Email:         Bruce.Simons at dpi.vic.gov.au
Alt Email:     Bruceasimons at hotmail.com
Country:       Australia 
KeyCode:       80WA5J9-CH4M7X8-07YX0P8-71LMYC9-TXJHPY1

Product:       XMLSpy_Professional_Edition
Version:       2011r2
OS:            win_xp
OS SP: 
OS Language: 
IE Version:    ff3.6
IE SP: 

-------------------------------------------------------------------
Summary:       XMLSpy refuses to validate GeoSciML instance documents

-------------------------------------------------------------------

Entered on 2011-05-16 at 17:51:27 by Riccardo Corona:
Dear Bruce,

Thank you for contacting us.

The first error appears to be reasonable in my opinion: in fact the 
'schemaLocation' element in the instance XML document tries to load a 
Schema
document with namespace 'http://xmlns.geosciml.org/GeoSciML-Core/3.0', 
while such Schema actually has 'http://xmlns.geosciml.org/GeoSciML/3.0' 
defined
as targetnamespace. The general mechanism is explained here:

http://www.w3schools.com/schema/schema_schema.asp

I believe the Altova engine implements the most strict strategy suggested 
by the specification:

http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#schema_reference

Regarding the error on the Schema: this again appears to be correctly 
raised by the validator. In fact even if the section:

http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#sch-props-correct

..is a subsection of '3.15 Schemas as a Whole', it clearly refers to *all* 
the Schemas that concur to the creation of the 'Schema as a whole'. All
those Schemas must respect the constraints:

****************************
3.15.6 Constraints on Schemas as a Whole

All schemas (see Schemas as a Whole (§3.15)) must satisfy the following 
constraint.
[...]
****************************

Perhaps you missed the above two lines because when you open the link from 
the error message in XMLSpy, you are prompted directly to the subsequent
constraints. 

Please let me know whether the above points sound correct to you.

Best regards,

Riccardo Corona
Support Engineer
Altova GmbH
www.altova.com

________________________________________
This e-mail and any attachments are intended only for the person/entity to 
which they are addressed and may contain confidential and/or privileged
material. If you received this in error, please notify the sender and 
delete the message. 
Altova GmbH, Firmenbuch: FN 50760 y, Sitz: Wien, DVR: 0692450, 
Handelsgericht: Wien, Rechtsform: Ges.m.b.H., UID: ATU16136802.

Entered on 2011-05-16 at 01:58:44 by bruce.simons at dpi.vic.gov.au:
Description:

When trying to validate a GeoSciML instance document (see attached) XMLSpy 
reports two errors:
1. Namespace Error
GeoSciML\branches\3.0.0_rc2\instances\GA_MappedFeature_GeologicUnit_wfs 
2.0.xml could not be validated because of an error in XML Schema/DTD (see 
below)         Schema at location 
'http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd' has target 
namespace 'http://xmlns.geosciml.org/GeoSciML/3.0' rather than 
'http://xmlns.geosciml.org/GeoSciML-Core/3.0'.                 Details     
          schema_reference: Schema at location 
'http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd' has target 
namespace 'http://xmlns.geosciml.org/GeoSciML/3.0' rather than 
'http://xmlns.geosciml.org/GeoSciML-Core/3.0'.

oXygen validates the geosciml.xsd schema and the GA instances.

I have tried re-reading the XML Schema spec. and although I'm not 
confident in my reading of this I don't think it is an error for the 
target namespace not to be the same. Loading the schema document at 
'http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd' will give a schema 
which can be used to validate elements in the 
'http://xmlns.geosciml.org/GeoSciML-Core/3.0' namespace. In particular, 
the part of the spec referred to by XMLSpy in its error message (
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#schema_reference) 
doesn't seem to imply this. So I *think* XMLSpy is wrong on this. (Note 
the rules for schemaLocation on import elements do require the target 
namespace of the referred schema be the same as the namespace attribute 
but this is not the same as the rules on the xsi:schemaLocation attribute 
on an instance document element.)

2. On switching the namespace (to overcome Error 1) obtain "already 
declared" error.

Changing the namespace in the instance document to "
http://xmlns.geosciml.org/GeoSciML/3.0 <
http://xmlns.geosciml.org/GeoSciML/3.0> 
http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd <
http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd> " results in the 
following error (the exact error varies but is always related to an 
already declared property):
'sam:SamplingFeatureComplex' is already declared in schema document 
'http://schemas.opengis.net/sampling/2.0/samplingFeature.xsd'.
         Error location: schema / element
Details
                 sch-props-correct.2: 'sam:SamplingFeatureComplex' is 
already declared in schema document 
'http://schemas.opengis.net/sampling/2.0/samplingFeature.xsd'.

Again switching the namespace to http://xmlns.geosciml.org/GeoSciML/3.0 
also works in oXygen.

The part of the Schema spec that XML Spy is pointing to for this to be an 
error is 
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#sch-props-correct 
about a schema not having more than one component with the same name but 
this refers to the final schema that gets constructed in the usual case 
according to the rules in Section 4 (
http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#composition) which, as 
far as I can make out, mean that it is OK to be importing the same 
definitions twice. In the above case, for example, the documents 
https://www.seegrid.csiro.au/subversion/GeoSciML/ISO19156_xsd/schemas/OM/om/2.0/observation.xsd 
and ://schemas.opengis.net/om/2.0/observation.xsd both have the same 
(empty) definition for the element {http://www.opengis.net/om/2.0, 
result}. So again I *think* that XMLSpy is wrong to say this is invalid.

Steps To Reproduce:

Reproduce Error 1:
1. Open XMLSpy
2. Load Attached Instance document

Reproduce error 2:
1. Repeat for error 1
2. Replace 
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 
http://schemas.opengis.net/wfs/2.0/wfs.xsd
                 http://www.opengis.net/gml/3.2 
http://schemas.opengis.net/gml/3.2.1/gml.xsd
                 http://xmlns.geosciml.org/GeoSciML-Core/3.0 
http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd" 

with:
xsi:schemaLocation="http://www.opengis.net/wfs/2.0 
http://schemas.opengis.net/wfs/2.0/wfs.xsd
                 http://www.opengis.net/gml/3.2 
http://schemas.opengis.net/gml/3.2.1/gml.xsd
                 http://xmlns.geosciml.org/GeoSciML/3.0 
http://schemas.geosciml.org/geosciml/3.0/geosciml.xsd"

-------------------------------------------------------------------

.. Altova Technical Support Group


Altova GmbH
www.altova.com

________________________________________________________________________________________________________________________
This e-mail and any attachments are intended only for the person/entity to 
which they are addressed and may contain 
confidential and/or privileged material. If you received this in error, 
please notify the sender and delete the message. 
Altova GmbH, Firmenbuch: FN 50760 y, Sitz: Wien, DVR: 0692450, 
Handelsgericht: Wien, Rechtsform: Ges.m.b.H., UID: 

ATU16136802.





Notice:
This email and any attachments may contain information that is personal, 
confidential, legally privileged and/or copyright.No part of it should be reproduced, 
adapted or communicated without the prior written consent of the copyright owner. 

It is the responsibility of the recipient to check for and remove viruses.
If you have received this email in error, please notify the sender by return email, delete 
it from your system and destroy any copies. You are not authorised to use, communicate or rely on the information 
contained in this email.

Please consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengeospatial.org/pipermail/geosciml/attachments/20110517/9c30cd12/attachment.htm>


More information about the GeoSciML mailing list