Select to view content in your preferred language

Create Metadata - Validation Behaviour

607
1
04-14-2010 05:18 PM
IanBeitzel
New Contributor
Hello all,

Just wondering if anyone has experienced this behaviour in their Geoportal instance - using Geoportal 9.3.1 sp1

I have created a metadata schema definition for the ANZLIC ISO Metadata Profile plus other metadata elements used in our organisation.  It is a fairly long form when all of the individual sections of elements are all open, so all sections are closed by default when the form is first called, and users can them open and close sections as they fill them in.

In some cases we are getting validation errors on empty elements when the record is submitted even though the metadata element in question is optional.  Further experimenting showed by having the section open or closed when submitting the metadata for validation determined whether the metadata validated or not.  For example, simply closing an empty section, and the record would validate and post successfully.  With the section open - it would return return errors e.g.

???Line 671 Column 50 cvc-complex-type.2.4.b: The content of element 'gml:TimePeriod' is not complete. One of '{"http://www.opengis.net/gml":metaDataProperty, "http://www.opengis.net/gml":description, "http://www.opengis.net/gml":descriptionReference, "http://www.opengis.net/gml":identifier, "http://www.opengis.net/gml":name, "http://www.opengis.net/gml":relatedTime, "http://www.opengis.net/gml":beginPosition, "http://www.opengis.net/gml":begin}' is expected.

So I'm just wondering if anyone else has seen the same or similar behaviour ,and if so, could you do anything to fix it?

Cheers
0 Kudos
1 Reply
WarwickHehir
Emerging Contributor
hello Ian,

You will need to look at the content of your definition file so that it deletes the elements you don't want.  See the sample-schema.xml.
See the example below, which is code from my definition file for the old ANZLIC ID:
  <parameter key="general.ANZLICfileIdentifier" meaning="ANZLICfileIdentifier">
   <label resourceKey="catalog.mdParam.general.ANZLICfileIdentifier"/>
   <input type="text" size="50" maxlength="2048" defaultValue=""/>
   <validation required="false"/> <!-- only required if old ANZLIC id exists -->
   <content useSelectForUpdate="true" select="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier[gmd:authority/gmd:CI_Citation/gmd:title/gco:CharacterString='ANZLIC Identifier']/gmd:code/gco:CharacterString"
      delete="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier"/>
  </parameter>

The above code will delete all elements under gmd:identifier if the field ../gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString is not completed.  This also has a qualifier the field under gmd:identifier "/gmd:MD_Identifier[gmd:authority/gmd:CI_Citation/gmd:title/gco:CharacterString='ANZLIC Identifier']" ie:  The gmd:identifier elements must be for ANZLIC Identifiers.  Hope that makes sense see W3Schools for further insight into the XML useage.
Warwick
0 Kudos