DataONEorg / collections-portals-schemas

Enabling project and data paper views via MetacatUI, Metacat, and EML
Apache License 2.0
3 stars 3 forks source link

XML validation errors for v1.1.0 examples #97

Closed gothub closed 3 years ago

gothub commented 3 years ago

The v1.1.0 example portal and collection documents don't validate against the v1.1.0 schemas.

The documents were tested using the commands:

xmllint --schema portals.xsd example-portal.xml
xmllint --schema collections.xsd example-collection.xml

with updated .xsd files with schemaLocation=<external file> replaced to use local files, as xmllint won't resolve URL references in .xsd files.

For https://github.com/DataONEorg/collections-portals-schemas/blob/1.1.0/docs/examples/example-collection.xml the errors were:

example-collection.xml:2: element collection: Schemas validity error : Element '{https://purl.dataone.org/collections-1.0.0}collection': No matching global declaration available for the validation root.

After updating the schema reference inside the example file to 1.1.0 and rerunning validation, these errors occurred:

example-collection.xml:18: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected. Expected is ( value ).
example-collection.xml:25: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected.
example-collection.xml fails to validate

For the portal example document at:

https://github.com/DataONEorg/collections-portals-schemas/blob/1.1.0/docs/examples/example-portal.xml

example-portal.xml:15: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected. Expected is ( value ).
example-portal.xml:30: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected.
example-portal.xml:36: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected.
example-portal.xml:42: element fieldsOperator: Schemas validity error : Element 'fieldsOperator': This element is not expected. Expected is ( max ).
example-portal.xml:320: element exclude: Schemas validity error : Element 'exclude': This element is not expected. Expected is one of ( matchSubstring, value, filterOptions, choice ).
example-portal.xml:376: element exclude: Schemas validity error : Element 'exclude': This element is not expected. Expected is one of ( matchSubstring, value, filterOptions, choice ).
example-portal.xml fails to validate

A PR will be submitted with updates to the sample docs that fix the validation errors.

robyngit commented 3 years ago

Thank you for finding and fixing these example docs, @gothub!!

gothub commented 3 years ago

Fixed in https://github.com/DataONEorg/collections-portals-schemas/pull/98