[GeoNetwork-devel] problem with substitutionGroup

Hi,
I've noticed that GN has problems with validation of some elements where
substiutionGroup is used. This error occurs when complex type is used to
substitute simple type (CharacterString). I've found two such elements:
Anchor and FileName. Can you fix this bug ?? I include error which occurs in
that situation and my xml file for tests:

2007-07-20 14:37:29,194 DEBUG [jeeves.webapp.util.import] - Importing :
C:\pliki_XML\iso19139_nasze\test\ortofotomapa_lotnicza_dataset.xml
2007-07-20 14:37:31,835 ERROR [jeeves.service] - Exception when executing
service
2007-07-20 14:37:31,835 ERROR [jeeves.service] - (C) Exc :
org.jdom.JDOMException: Exception in startElement: cvc-complex-type.2.4.a:
Invalid content was found starting with element 'Anchor'. One of
'{"http://www.isotc211.org/2005/gco":CharacterString\}' is expected.
2007-07-20 14:37:31,835 DEBUG [jeeves.service] - Raised exception while
executing service
<error id="error">
  <message>Exception in startElement: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'Anchor'. One of
'{"http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is
expected.</message>
  <class>SAXException</class>
  <stack>
    <at class="org.jdom.transform.JDOMSource$DocumentReader"
file="JDOMSource.java" line="483" method="parse" />
    <at
class="com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl"
file="???" line="-1" method="process" />
    <at
class="com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl"
file="???" line="-1" method="validate" />
    <at class="javax.xml.validation.Validator" file="???" line="-1"
method="validate" />
    <at class="jeeves.utils.Xml" file="Xml.java" line="231"
method="validate" />
    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java"
line="277" method="validate" />
    <at class="org.fao.geonet.services.metadata.ImportFromDir"
file="ImportFromDir.java" line="164" method="standardImport" />
    <at class="org.fao.geonet.services.metadata.ImportFromDir"
file="ImportFromDir.java" line="116" method="exec" />
    <at class="jeeves.server.dispatchers.ServiceInfo"
file="ServiceInfo.java" line="238" method="execService" />
    <at class="jeeves.server.dispatchers.ServiceInfo"
file="ServiceInfo.java" line="141" method="execServices" />
  </stack>
  <request>
    <language>en</language>
    <service>util.import</service>
  </request>
</error>

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

<?xml version="1.0" encoding="utf-8"?>

<MD_Metadata xmlns="http://www.isotc211.org/2005/gmd&quot;
uuid="71ebcf00-14b6-4852-a016-306b72b56b0a"
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:gco="http://www.isotc211.org/2005/gco&quot;
xmlns:gml="http://www.isotc211.org/2005/gml&quot;
xmlns:gmx="http://www.isotc211.org/2005/gmx&quot;&gt;
  <fileIdentifier>
   
<gco:CharacterString>71ebcf00-14b6-4852-a016-306b72b56b0a</gco:CharacterString>
  </fileIdentifier>
  <language>
    <gco:CharacterString>pol</gco:CharacterString>
  </language>
  <characterSet>
    <MD_CharacterSetCode
codeList="./resources/codeList.xml#MD_CharacterSetCode"
codeListValue="utf8">utf8</MD_CharacterSetCode>
  </characterSet>
  <parentIdentifier>
   
<gco:CharacterString>0d66d03d-2677-4642-8bdd-110136446bc1</gco:CharacterString>
  </parentIdentifier>
  <hierarchyLevel>
    <MD_ScopeCode codeList="./resources/codeList.xml#MD_ScopeCode"
codeListValue="dataset">dataset</MD_ScopeCode>
  </hierarchyLevel>
  <contact>
    <CI_ResponsibleParty uuid="8">
      <organisationName>
        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
      </organisationName>
      <contactInfo>
        <CI_Contact uuid="1">
          <phone>
            <CI_Telephone>
              <voice>
                <gco:CharacterString>+480221111111</gco:CharacterString>
              </voice>
              <facsimile>
                <gco:CharacterString>+480221111111</gco:CharacterString>
              </facsimile>
            </CI_Telephone>
          </phone>
          <address>
            <CI_Address>
              <deliveryPoint>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </deliveryPoint>
              <city>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </city>
              <administrativeArea>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </administrativeArea>
              <postalCode>
                <gco:CharacterString>11-111</gco:CharacterString>
              </postalCode>
              <country>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </country>
              <electronicMailAddress>
               
<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
              </electronicMailAddress>
            </CI_Address>
          </address>
          <onlineResource>
            <CI_OnlineResource>
              <linkage>
                <URL>http://www.aaaaaaaa.pl</URL>
              </linkage>
            </CI_OnlineResource>
          </onlineResource>
          <hoursOfService>
            <gco:CharacterString>Godziny pracy w dni powszednie 7.45-15.45.
W weekendy zamknięte.</gco:CharacterString>
          </hoursOfService>
        </CI_Contact>
      </contactInfo>
      <role>
        <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="author">author</CI_RoleCode>
      </role>
    </CI_ResponsibleParty>
  </contact>
  <dateStamp>
    <gco:DateTime>2007-06-20T09:45:00</gco:DateTime>
  </dateStamp>
  <metadataStandardName>
    <gco:CharacterString>ISO 19115 Geographic Information -
Metadata</gco:CharacterString>
  </metadataStandardName>
  <metadataStandardVersion>
    <gco:CharacterString>First Edition 2003-05-01</gco:CharacterString>
  </metadataStandardVersion>
  <referenceSystemInfo>
    <MD_ReferenceSystem uuid="3">
      <referenceSystemIdentifier>
        <RS_Identifier>
          <authority>
            <CI_Citation>
              <title>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </title>
              <date>
                <CI_Date>
                  <date>
                    <gco:Date>2007-02-02</gco:Date>
                  </date>
                  <dateType>
                    <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="revision">revision</CI_DateTypeCode>
                  </dateType>
                </CI_Date>
              </date>
              <citedResponsibleParty>
                <CI_ResponsibleParty uuid="36">
                  <organisationName>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </organisationName>
                  <contactInfo>
                    <CI_Contact uuid="5">
                      <phone>
                        <CI_Telephone>
                          <voice>
                           
<gco:CharacterString>+480221111111</gco:CharacterString>
                          </voice>
                          <facsimile>
                           
<gco:CharacterString>+480221111111</gco:CharacterString>
                          </facsimile>
                        </CI_Telephone>
                      </phone>
                      <address>
                        <CI_Address>
                          <deliveryPoint>
                            <gco:CharacterString>111-111
aaaaaaaa</gco:CharacterString>
                          </deliveryPoint>
                          <city>
                           
<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </city>
                          <administrativeArea>
                           
<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </administrativeArea>
                          <postalCode>
                           
<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </postalCode>
                          <country>
                           
<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </country>
                          <electronicMailAddress>
                           
<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                          </electronicMailAddress>
                        </CI_Address>
                      </address>
                      <onlineResource>
                        <CI_OnlineResource>
                          <linkage>
                            <URL>http://www.aaaaaaaa.uk</URL>
                          </linkage>
                        </CI_OnlineResource>
                      </onlineResource>
                    </CI_Contact>
                  </contactInfo>
                  <role>
                    <CI_RoleCode
codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="publisher">publisher</CI_RoleCode>
                  </role>
                </CI_ResponsibleParty>
              </citedResponsibleParty>
            </CI_Citation>
          </authority>
          <code>
            <Anchor
xlink:href="http://www.epsg.org/databases/epsg-v6_12.zip&quot;&gt;2180&lt;/Anchor&gt;
          </code>
        </RS_Identifier>
      </referenceSystemIdentifier>
    </MD_ReferenceSystem>
  </referenceSystemInfo>
  <series xlink:href="./ortofotomapa_lotnicza_seria.xml"
xlink:type="simple"/>
  <identificationInfo>
    <MD_DataIdentification>
      <citation>
        <CI_Citation>
          <title>
            <gco:CharacterString>N-34-127-C-a-3</gco:CharacterString>
          </title>
          <alternateTitle>
            <gco:CharacterString>brak wartoĹ›ci</gco:CharacterString>
          </alternateTitle>
          <date>
            <CI_Date>
              <date>
                <gco:Date>2002</gco:Date>
              </date>
              <dateType>
                <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="creation">creation</CI_DateTypeCode>
              </dateType>
            </CI_Date>
          </date>
          <date>
            <CI_Date>
              <date>
                <gco:Date>2002</gco:Date>
              </date>
              <dateType>
                <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="publication">publication</CI_DateTypeCode>
              </dateType>
            </CI_Date>
          </date>
          <citedResponsibleParty>
            <CI_ResponsibleParty uuid="20">
              <organisationName>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </organisationName>
              <contactInfo>
                <CI_Contact uuid="10">
                  <phone>
                    <CI_Telephone>
                      <voice>
                       
<gco:CharacterString>+480221111111</gco:CharacterString>
                      </voice>
                      <facsimile>
                       
<gco:CharacterString>+480221111111</gco:CharacterString>
                      </facsimile>
                    </CI_Telephone>
                  </phone>
                  <address>
                    <CI_Address>
                      <deliveryPoint>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </deliveryPoint>
                      <city>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </city>
                      <administrativeArea>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </administrativeArea>
                      <postalCode>
                        <gco:CharacterString>11-111</gco:CharacterString>
                      </postalCode>
                      <country>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </country>
                      <electronicMailAddress>
                       
<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                      </electronicMailAddress>
                    </CI_Address>
                  </address>
                  <onlineResource>
                    <CI_OnlineResource>
                      <linkage>
                        <URL>http://www.aaaaaaaa.pl</URL>
                      </linkage>
                    </CI_OnlineResource>
                  </onlineResource>
                </CI_Contact>
              </contactInfo>
              <role>
                <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="originator">originator</CI_RoleCode>
              </role>
            </CI_ResponsibleParty>
          </citedResponsibleParty>
          <presentationForm>
            <CI_PresentationFormCode
codeList="./resources/codeList.xml#CI_PresentationFormCode"
codeListValue="mapDigital">mapDigital</CI_PresentationFormCode>
          </presentationForm>
        </CI_Citation>
      </citation>
      <abstract>
        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
      </abstract>
      <purpose>
        <gco:CharacterString>Wykonanie aktualnego opracowania
fotogrametrycznego.</gco:CharacterString>
      </purpose>
      <status>
        <MD_ProgressCode codeList="./resources/codeList.xml#MD_ProgressCode"
codeListValue="completed">completed</MD_ProgressCode>
      </status>
      <pointOfContact>
        <CI_ResponsibleParty uuid="1">
          <organisationName>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </organisationName>
          <contactInfo>
            <CI_Contact uuid="1">
              <phone>
                <CI_Telephone>
                  <voice>
                    <gco:CharacterString>+480221111111</gco:CharacterString>
                  </voice>
                  <facsimile>
                    <gco:CharacterString>+480221111111</gco:CharacterString>
                  </facsimile>
                </CI_Telephone>
              </phone>
              <address>
                <CI_Address>
                  <deliveryPoint>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </deliveryPoint>
                  <city>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </city>
                  <administrativeArea>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </administrativeArea>
                  <postalCode>
                    <gco:CharacterString>11-111</gco:CharacterString>
                  </postalCode>
                  <country>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </country>
                  <electronicMailAddress>
                   
<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                  </electronicMailAddress>
                </CI_Address>
              </address>
              <onlineResource>
                <CI_OnlineResource>
                  <linkage>
                    <URL>http://www.aaaaaaaa.pl</URL>
                  </linkage>
                </CI_OnlineResource>
              </onlineResource>
              <hoursOfService>
                <gco:CharacterString>Godziny pracy w dni powszednie
7.45-15.45. W weekendy zamknięte.</gco:CharacterString>
              </hoursOfService>
            </CI_Contact>
          </contactInfo>
          <role>
            <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="pointOfContact">pointOfContact</CI_RoleCode>
          </role>
        </CI_ResponsibleParty>
      </pointOfContact>
      <resourceMaintenance>
        <MD_MaintenanceInformation>
          <maintenanceAndUpdateFrequency>
            <MD_MaintenanceFrequencyCode
codeList="./resources/codeList.xml#MD_MaintenanceFrequencyCode"
codeListValue="notPlanned">notPlanned</MD_MaintenanceFrequencyCode>
          </maintenanceAndUpdateFrequency>
          <maintenanceNote gco:nilReason="inapplicable" />
        </MD_MaintenanceInformation>
      </resourceMaintenance>
      <graphicOverview>
        <MD_BrowseGraphic>
          <fileName>
            <FileName
src="http://www.gismazowsza.pl/database/mdGrapOvView/036_wisla.jpg&quot;&gt;PrzeglÄ…danie&lt;/FileName&gt;
          </fileName>
          <fileDescription>
            <gco:CharacterString>Fragment opracowania.</gco:CharacterString>
          </fileDescription>
          <fileType>
            <gmx:MimeFileType type="image/jpeg">Plik graficzny
JPEG</gmx:MimeFileType>
          </fileType>
        </MD_BrowseGraphic>
      </graphicOverview>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>dgn</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>V7</gco:CharacterString>
          </version>
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>dwg</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>cdr</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="15">
          <name>
            <gco:CharacterString>cot</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>t</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <descriptiveKeywords>
        <MD_Keywords>
          <keyword>
            <gco:CharacterString>ortofotomapa</gco:CharacterString>
          </keyword>
          <keyword>
            <gco:CharacterString>pokrycie terenu</gco:CharacterString>
          </keyword>
          <type>
            <MD_KeywordTypeCode
codeList="./resources/codeList.xml#MD_KeywordTypeCode"
codeListValue="theme">theme</MD_KeywordTypeCode>
          </type>
        </MD_Keywords>
      </descriptiveKeywords>
      <descriptiveKeywords>
        <MD_Keywords>
          <keyword>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </keyword>
          <type>
            <MD_KeywordTypeCode
codeList="./resources/codeList.xml#MD_KeywordTypeCode"
codeListValue="place">place</MD_KeywordTypeCode>
          </type>
        </MD_Keywords>
      </descriptiveKeywords>
      <resourceConstraints>
        <MD_LegalConstraints uuid="1">
          <accessConstraints>
            <MD_RestrictionCode
codeList="./resources/codeList.xml#MD_RestrictionCode"
codeListValue="license">license</MD_RestrictionCode>
          </accessConstraints>
          <useConstraints>
            <MD_RestrictionCode
codeList="./resources/codeList.xml#MD_RestrictionCode"
codeListValue="license">license</MD_RestrictionCode>
          </useConstraints>
          <otherConstraints>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </otherConstraints>
        </MD_LegalConstraints>
      </resourceConstraints>
      <resourceConstraints>
        <MD_SecurityConstraints>
          <classification>
            <MD_ClassificationCode
codeList="./resources/codeList.xml#MD_ClassificationCode"
codeListValue="unclassified">unclassified</MD_ClassificationCode>
          </classification>
        </MD_SecurityConstraints>
      </resourceConstraints>
      <spatialRepresentationType>
        <MD_SpatialRepresentationTypeCode
codeList="./resources/codeList.xml#MD_SpatialRepresentationTypeCode"
codeListValue="vector">vector</MD_SpatialRepresentationTypeCode>
      </spatialRepresentationType>
      <spatialRepresentationType>
        <MD_SpatialRepresentationTypeCode
codeList="./resources/codeList.xml#MD_SpatialRepresentationTypeCode"
codeListValue="grid">grid</MD_SpatialRepresentationTypeCode>
      </spatialRepresentationType>
      <spatialResolution>
        <MD_Resolution>
          <distance>
            <gco:Distance uom="m">0.00</gco:Distance>
          </distance>
        </MD_Resolution>
      </spatialResolution>
      <language>
        <gco:CharacterString>pol</gco:CharacterString>
      </language>
      <topicCategory>
       
<MD_TopicCategoryCode>imageryBaseMapsEarthCover</MD_TopicCategoryCode>
      </topicCategory>
      <extent>
        <EX_Extent>
          <geographicElement>
            <EX_GeographicBoundingBox uuid="6">
              <westBoundLongitude>
                <gco:Decimal>21.000000</gco:Decimal>
              </westBoundLongitude>
              <eastBoundLongitude>
                <gco:Decimal>21.062500</gco:Decimal>
              </eastBoundLongitude>
              <southBoundLatitude>
                <gco:Decimal>52.416667</gco:Decimal>
              </southBoundLatitude>
              <northBoundLatitude>
                <gco:Decimal>52.458333</gco:Decimal>
              </northBoundLatitude>
            </EX_GeographicBoundingBox>
          </geographicElement>
          <temporalElement>
            <EX_TemporalExtent>
              <extent>
                <gml:TimeInstant>
                  <gml:timePosition>2001</gml:timePosition>
                </gml:TimeInstant>
              </extent>
            </EX_TemporalExtent>
          </temporalElement>
        </EX_Extent>
      </extent>
    </MD_DataIdentification>
  </identificationInfo>
  <distributionInfo>
    <MD_Distribution>
      <distributionFormat>
        <MD_Format uuid="15">
          <name>
            <gco:CharacterString>cot</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </distributionFormat>
      <distributionFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>geoTiff</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>1</gco:CharacterString>
          </version>
        </MD_Format>
      </distributionFormat>
      <distributionFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>geoTiff</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>1</gco:CharacterString>
          </version>
        </MD_Format>
      </distributionFormat>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
    </MD_Distribution>
  </distributionInfo>
</MD_Metadata>

--
View this message in context: http://www.nabble.com/problem-with-substitutionGroup-tf4116813s18419.html#a11707414
Sent from the geonetwork-devel mailing list archive at Nabble.com.

Hi Lukasz,

Maybe I'm mistaken, but don't you have to supply fileName elements as follows:
<fileName><gco:CharacterString>actual_file_name</gco:CharacterString></fileName> and similar for Anchor?

The parser error says that an element of type gco:characterString is
expected (and something else is found instead, which makes it invalid), so it's only logical to
supply that, no?

Cheers,

Tim

From: Lukasz_Sobotowski <l.sobotowski@anonymised.com>
To: geonetwork-devel@lists.sourceforge.net
Subject: [GeoNetwork-devel] problem with substitutionGroup
Date: Fri, 20 Jul 2007 05:39:15 -0700 (PDT)

Hi,
I've noticed that GN has problems with validation of some elements where
substiutionGroup is used. This error occurs when complex type is used to
substitute simple type (CharacterString). I've found two such elements:
Anchor and FileName. Can you fix this bug ?? I include error which occurs in
that situation and my xml file for tests:

2007-07-20 14:37:29,194 DEBUG [jeeves.webapp.util.import] - Importing :
C:\pliki_XML\iso19139_nasze\test\ortofotomapa_lotnicza_dataset.xml
2007-07-20 14:37:31,835 ERROR [jeeves.service] - Exception when executing
service
2007-07-20 14:37:31,835 ERROR [jeeves.service] - (C) Exc :
org.jdom.JDOMException: Exception in startElement: cvc-complex-type.2.4.a:
Invalid content was found starting with element 'Anchor'. One of
'{"http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is expected.
2007-07-20 14:37:31,835 DEBUG [jeeves.service] - Raised exception while
executing service
<error id="error">
  <message>Exception in startElement: cvc-complex-type.2.4.a: Invalid
content was found starting with element 'Anchor'. One of
'{"http://www.isotc211.org/2005/gco&quot;:CharacterString\}' is
expected.</message>
  <class>SAXException</class>
  <stack>
    <at class="org.jdom.transform.JDOMSource$DocumentReader"
file="JDOMSource.java" line="483" method="parse" />
    <at
class="com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl"
file="???" line="-1" method="process" />
    <at
class="com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl"
file="???" line="-1" method="validate" />
    <at class="javax.xml.validation.Validator" file="???" line="-1"
method="validate" />
    <at class="jeeves.utils.Xml" file="Xml.java" line="231"
method="validate" />
    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java"
line="277" method="validate" />
    <at class="org.fao.geonet.services.metadata.ImportFromDir"
file="ImportFromDir.java" line="164" method="standardImport" />
    <at class="org.fao.geonet.services.metadata.ImportFromDir"
file="ImportFromDir.java" line="116" method="exec" />
    <at class="jeeves.server.dispatchers.ServiceInfo"
file="ServiceInfo.java" line="238" method="execService" />
    <at class="jeeves.server.dispatchers.ServiceInfo"
file="ServiceInfo.java" line="141" method="execServices" />
  </stack>
  <request>
    <language>en</language>
    <service>util.import</service>
  </request>
</error>

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

<?xml version="1.0" encoding="utf-8"?>

<MD_Metadata xmlns="http://www.isotc211.org/2005/gmd&quot;
uuid="71ebcf00-14b6-4852-a016-306b72b56b0a"
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:gco="http://www.isotc211.org/2005/gco&quot;
xmlns:gml="http://www.isotc211.org/2005/gml&quot;
xmlns:gmx="http://www.isotc211.org/2005/gmx&quot;&gt;
  <fileIdentifier>

<gco:CharacterString>71ebcf00-14b6-4852-a016-306b72b56b0a</gco:CharacterString>
  </fileIdentifier>
  <language>
    <gco:CharacterString>pol</gco:CharacterString>
  </language>
  <characterSet>
    <MD_CharacterSetCode
codeList="./resources/codeList.xml#MD_CharacterSetCode"
codeListValue="utf8">utf8</MD_CharacterSetCode>
  </characterSet>
  <parentIdentifier>

<gco:CharacterString>0d66d03d-2677-4642-8bdd-110136446bc1</gco:CharacterString>
  </parentIdentifier>
  <hierarchyLevel>
    <MD_ScopeCode codeList="./resources/codeList.xml#MD_ScopeCode"
codeListValue="dataset">dataset</MD_ScopeCode>
  </hierarchyLevel>
  <contact>
    <CI_ResponsibleParty uuid="8">
      <organisationName>
        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
      </organisationName>
      <contactInfo>
        <CI_Contact uuid="1">
          <phone>
            <CI_Telephone>
              <voice>
                <gco:CharacterString>+480221111111</gco:CharacterString>
              </voice>
              <facsimile>
                <gco:CharacterString>+480221111111</gco:CharacterString>
              </facsimile>
            </CI_Telephone>
          </phone>
          <address>
            <CI_Address>
              <deliveryPoint>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </deliveryPoint>
              <city>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </city>
              <administrativeArea>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </administrativeArea>
              <postalCode>
                <gco:CharacterString>11-111</gco:CharacterString>
              </postalCode>
              <country>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </country>
              <electronicMailAddress>

<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
              </electronicMailAddress>
            </CI_Address>
          </address>
          <onlineResource>
            <CI_OnlineResource>
              <linkage>
                <URL>http://www.aaaaaaaa.pl</URL>
              </linkage>
            </CI_OnlineResource>
          </onlineResource>
          <hoursOfService>
            <gco:CharacterString>Godziny pracy w dni powszednie 7.45-15.45.
W weekendy zamknięte.</gco:CharacterString>
          </hoursOfService>
        </CI_Contact>
      </contactInfo>
      <role>
        <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="author">author</CI_RoleCode>
      </role>
    </CI_ResponsibleParty>
  </contact>
  <dateStamp>
    <gco:DateTime>2007-06-20T09:45:00</gco:DateTime>
  </dateStamp>
  <metadataStandardName>
    <gco:CharacterString>ISO 19115 Geographic Information -
Metadata</gco:CharacterString>
  </metadataStandardName>
  <metadataStandardVersion>
    <gco:CharacterString>First Edition 2003-05-01</gco:CharacterString>
  </metadataStandardVersion>
  <referenceSystemInfo>
    <MD_ReferenceSystem uuid="3">
      <referenceSystemIdentifier>
        <RS_Identifier>
          <authority>
            <CI_Citation>
              <title>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </title>
              <date>
                <CI_Date>
                  <date>
                    <gco:Date>2007-02-02</gco:Date>
                  </date>
                  <dateType>
                    <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="revision">revision</CI_DateTypeCode>
                  </dateType>
                </CI_Date>
              </date>
              <citedResponsibleParty>
                <CI_ResponsibleParty uuid="36">
                  <organisationName>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </organisationName>
                  <contactInfo>
                    <CI_Contact uuid="5">
                      <phone>
                        <CI_Telephone>
                          <voice>

<gco:CharacterString>+480221111111</gco:CharacterString>
                          </voice>
                          <facsimile>

<gco:CharacterString>+480221111111</gco:CharacterString>
                          </facsimile>
                        </CI_Telephone>
                      </phone>
                      <address>
                        <CI_Address>
                          <deliveryPoint>
                            <gco:CharacterString>111-111
aaaaaaaa</gco:CharacterString>
                          </deliveryPoint>
                          <city>

<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </city>
                          <administrativeArea>

<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </administrativeArea>
                          <postalCode>

<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </postalCode>
                          <country>

<gco:CharacterString>aaaaaaaa</gco:CharacterString>
                          </country>
                          <electronicMailAddress>

<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                          </electronicMailAddress>
                        </CI_Address>
                      </address>
                      <onlineResource>
                        <CI_OnlineResource>
                          <linkage>
                            <URL>http://www.aaaaaaaa.uk</URL>
                          </linkage>
                        </CI_OnlineResource>
                      </onlineResource>
                    </CI_Contact>
                  </contactInfo>
                  <role>
                    <CI_RoleCode
codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="publisher">publisher</CI_RoleCode>
                  </role>
                </CI_ResponsibleParty>
              </citedResponsibleParty>
            </CI_Citation>
          </authority>
          <code>
            <Anchor
xlink:href="http://www.epsg.org/databases/epsg-v6_12.zip&quot;&gt;2180&lt;/Anchor&gt;
          </code>
        </RS_Identifier>
      </referenceSystemIdentifier>
    </MD_ReferenceSystem>
  </referenceSystemInfo>
  <series xlink:href="./ortofotomapa_lotnicza_seria.xml"
xlink:type="simple"/>
  <identificationInfo>
    <MD_DataIdentification>
      <citation>
        <CI_Citation>
          <title>
            <gco:CharacterString>N-34-127-C-a-3</gco:CharacterString>
          </title>
          <alternateTitle>
            <gco:CharacterString>brak wartoĹ›ci</gco:CharacterString>
          </alternateTitle>
          <date>
            <CI_Date>
              <date>
                <gco:Date>2002</gco:Date>
              </date>
              <dateType>
                <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="creation">creation</CI_DateTypeCode>
              </dateType>
            </CI_Date>
          </date>
          <date>
            <CI_Date>
              <date>
                <gco:Date>2002</gco:Date>
              </date>
              <dateType>
                <CI_DateTypeCode
codeList="./resources/codeList.xml#CI_DateTypeCode"
codeListValue="publication">publication</CI_DateTypeCode>
              </dateType>
            </CI_Date>
          </date>
          <citedResponsibleParty>
            <CI_ResponsibleParty uuid="20">
              <organisationName>
                <gco:CharacterString>aaaaaaaa</gco:CharacterString>
              </organisationName>
              <contactInfo>
                <CI_Contact uuid="10">
                  <phone>
                    <CI_Telephone>
                      <voice>

<gco:CharacterString>+480221111111</gco:CharacterString>
                      </voice>
                      <facsimile>

<gco:CharacterString>+480221111111</gco:CharacterString>
                      </facsimile>
                    </CI_Telephone>
                  </phone>
                  <address>
                    <CI_Address>
                      <deliveryPoint>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </deliveryPoint>
                      <city>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </city>
                      <administrativeArea>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </administrativeArea>
                      <postalCode>
                        <gco:CharacterString>11-111</gco:CharacterString>
                      </postalCode>
                      <country>
                        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                      </country>
                      <electronicMailAddress>

<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                      </electronicMailAddress>
                    </CI_Address>
                  </address>
                  <onlineResource>
                    <CI_OnlineResource>
                      <linkage>
                        <URL>http://www.aaaaaaaa.pl</URL>
                      </linkage>
                    </CI_OnlineResource>
                  </onlineResource>
                </CI_Contact>
              </contactInfo>
              <role>
                <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="originator">originator</CI_RoleCode>
              </role>
            </CI_ResponsibleParty>
          </citedResponsibleParty>
          <presentationForm>
            <CI_PresentationFormCode
codeList="./resources/codeList.xml#CI_PresentationFormCode"
codeListValue="mapDigital">mapDigital</CI_PresentationFormCode>
          </presentationForm>
        </CI_Citation>
      </citation>
      <abstract>
        <gco:CharacterString>aaaaaaaa</gco:CharacterString>
      </abstract>
      <purpose>
        <gco:CharacterString>Wykonanie aktualnego opracowania
fotogrametrycznego.</gco:CharacterString>
      </purpose>
      <status>
        <MD_ProgressCode codeList="./resources/codeList.xml#MD_ProgressCode"
codeListValue="completed">completed</MD_ProgressCode>
      </status>
      <pointOfContact>
        <CI_ResponsibleParty uuid="1">
          <organisationName>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </organisationName>
          <contactInfo>
            <CI_Contact uuid="1">
              <phone>
                <CI_Telephone>
                  <voice>
                    <gco:CharacterString>+480221111111</gco:CharacterString>
                  </voice>
                  <facsimile>
                    <gco:CharacterString>+480221111111</gco:CharacterString>
                  </facsimile>
                </CI_Telephone>
              </phone>
              <address>
                <CI_Address>
                  <deliveryPoint>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </deliveryPoint>
                  <city>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </city>
                  <administrativeArea>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </administrativeArea>
                  <postalCode>
                    <gco:CharacterString>11-111</gco:CharacterString>
                  </postalCode>
                  <country>
                    <gco:CharacterString>aaaaaaaa</gco:CharacterString>
                  </country>
                  <electronicMailAddress>

<gco:CharacterString>aaaaaaaa@anonymised.com</gco:CharacterString>
                  </electronicMailAddress>
                </CI_Address>
              </address>
              <onlineResource>
                <CI_OnlineResource>
                  <linkage>
                    <URL>http://www.aaaaaaaa.pl</URL>
                  </linkage>
                </CI_OnlineResource>
              </onlineResource>
              <hoursOfService>
                <gco:CharacterString>Godziny pracy w dni powszednie
7.45-15.45. W weekendy zamknięte.</gco:CharacterString>
              </hoursOfService>
            </CI_Contact>
          </contactInfo>
          <role>
            <CI_RoleCode codeList="./resources/codeList.xml#CI_RoleCode"
codeListValue="pointOfContact">pointOfContact</CI_RoleCode>
          </role>
        </CI_ResponsibleParty>
      </pointOfContact>
      <resourceMaintenance>
        <MD_MaintenanceInformation>
          <maintenanceAndUpdateFrequency>
            <MD_MaintenanceFrequencyCode
codeList="./resources/codeList.xml#MD_MaintenanceFrequencyCode"
codeListValue="notPlanned">notPlanned</MD_MaintenanceFrequencyCode>
          </maintenanceAndUpdateFrequency>
          <maintenanceNote gco:nilReason="inapplicable" />
        </MD_MaintenanceInformation>
      </resourceMaintenance>
      <graphicOverview>
        <MD_BrowseGraphic>
          <fileName>
            <FileName
src="http://www.gismazowsza.pl/database/mdGrapOvView/036_wisla.jpg&quot;&gt;PrzeglÄ…danie</FileName>
          </fileName>
          <fileDescription>
            <gco:CharacterString>Fragment opracowania.</gco:CharacterString>
          </fileDescription>
          <fileType>
            <gmx:MimeFileType type="image/jpeg">Plik graficzny
JPEG</gmx:MimeFileType>
          </fileType>
        </MD_BrowseGraphic>
      </graphicOverview>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>dgn</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>V7</gco:CharacterString>
          </version>
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>dwg</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="16">
          <name>
            <gco:CharacterString>cdr</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="15">
          <name>
            <gco:CharacterString>cot</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <resourceFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>t</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </resourceFormat>
      <descriptiveKeywords>
        <MD_Keywords>
          <keyword>
            <gco:CharacterString>ortofotomapa</gco:CharacterString>
          </keyword>
          <keyword>
            <gco:CharacterString>pokrycie terenu</gco:CharacterString>
          </keyword>
          <type>
            <MD_KeywordTypeCode
codeList="./resources/codeList.xml#MD_KeywordTypeCode"
codeListValue="theme">theme</MD_KeywordTypeCode>
          </type>
        </MD_Keywords>
      </descriptiveKeywords>
      <descriptiveKeywords>
        <MD_Keywords>
          <keyword>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </keyword>
          <type>
            <MD_KeywordTypeCode
codeList="./resources/codeList.xml#MD_KeywordTypeCode"
codeListValue="place">place</MD_KeywordTypeCode>
          </type>
        </MD_Keywords>
      </descriptiveKeywords>
      <resourceConstraints>
        <MD_LegalConstraints uuid="1">
          <accessConstraints>
            <MD_RestrictionCode
codeList="./resources/codeList.xml#MD_RestrictionCode"
codeListValue="license">license</MD_RestrictionCode>
          </accessConstraints>
          <useConstraints>
            <MD_RestrictionCode
codeList="./resources/codeList.xml#MD_RestrictionCode"
codeListValue="license">license</MD_RestrictionCode>
          </useConstraints>
          <otherConstraints>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </otherConstraints>
        </MD_LegalConstraints>
      </resourceConstraints>
      <resourceConstraints>
        <MD_SecurityConstraints>
          <classification>
            <MD_ClassificationCode
codeList="./resources/codeList.xml#MD_ClassificationCode"
codeListValue="unclassified">unclassified</MD_ClassificationCode>
          </classification>
        </MD_SecurityConstraints>
      </resourceConstraints>
      <spatialRepresentationType>
        <MD_SpatialRepresentationTypeCode
codeList="./resources/codeList.xml#MD_SpatialRepresentationTypeCode"
codeListValue="vector">vector</MD_SpatialRepresentationTypeCode>
      </spatialRepresentationType>
      <spatialRepresentationType>
        <MD_SpatialRepresentationTypeCode
codeList="./resources/codeList.xml#MD_SpatialRepresentationTypeCode"
codeListValue="grid">grid</MD_SpatialRepresentationTypeCode>
      </spatialRepresentationType>
      <spatialResolution>
        <MD_Resolution>
          <distance>
            <gco:Distance uom="m">0.00</gco:Distance>
          </distance>
        </MD_Resolution>
      </spatialResolution>
      <language>
        <gco:CharacterString>pol</gco:CharacterString>
      </language>
      <topicCategory>

<MD_TopicCategoryCode>imageryBaseMapsEarthCover</MD_TopicCategoryCode>
      </topicCategory>
      <extent>
        <EX_Extent>
          <geographicElement>
            <EX_GeographicBoundingBox uuid="6">
              <westBoundLongitude>
                <gco:Decimal>21.000000</gco:Decimal>
              </westBoundLongitude>
              <eastBoundLongitude>
                <gco:Decimal>21.062500</gco:Decimal>
              </eastBoundLongitude>
              <southBoundLatitude>
                <gco:Decimal>52.416667</gco:Decimal>
              </southBoundLatitude>
              <northBoundLatitude>
                <gco:Decimal>52.458333</gco:Decimal>
              </northBoundLatitude>
            </EX_GeographicBoundingBox>
          </geographicElement>
          <temporalElement>
            <EX_TemporalExtent>
              <extent>
                <gml:TimeInstant>
                  <gml:timePosition>2001</gml:timePosition>
                </gml:TimeInstant>
              </extent>
            </EX_TemporalExtent>
          </temporalElement>
        </EX_Extent>
      </extent>
    </MD_DataIdentification>
  </identificationInfo>
  <distributionInfo>
    <MD_Distribution>
      <distributionFormat>
        <MD_Format uuid="15">
          <name>
            <gco:CharacterString>cot</gco:CharacterString>
          </name>
          <version gco:nilReason="unknown" />
        </MD_Format>
      </distributionFormat>
      <distributionFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>geoTiff</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>1</gco:CharacterString>
          </version>
        </MD_Format>
      </distributionFormat>
      <distributionFormat>
        <MD_Format uuid="8">
          <name>
            <gco:CharacterString>geoTiff</gco:CharacterString>
          </name>
          <version>
            <gco:CharacterString>1</gco:CharacterString>
          </version>
        </MD_Format>
      </distributionFormat>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
      <transferOptions>
        <MD_DigitalTransferOptions>
          <unitsOfDistribution>
            <gco:CharacterString>aaaaaaaa</gco:CharacterString>
          </unitsOfDistribution>
        </MD_DigitalTransferOptions>
      </transferOptions>
    </MD_Distribution>
  </distributionInfo>
</MD_Metadata>

--
View this message in context: http://www.nabble.com/problem-with-substitutionGroup-tf4116813s18419.html#a11707414
Sent from the geonetwork-devel mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

_________________________________________________________________
Looking for an old friend? You may find him in your friends' friends list ! http://spaces.live.com/default.aspx?page=Ed01&ss=True

Tim Jacobs wrote:

Hi Lukasz,

Maybe I'm mistaken, but don't you have to supply fileName elements as follows:
<fileName><gco:CharacterString>actual_file_name</gco:CharacterString></fileName> and similar for Anchor?

The parser error says that an element of type gco:characterString is
expected (and something else is found instead, which makes it invalid), so it's only logical to
supply that, no?

Hi Tim and Lukasz,

I reckon Lukasz's xml is well on the way to validation (except for the missing gmx: prefix on FileName and Anchor, gmd:series breaking the order of the sequence and missing mandatory content!) - I've spent a fair bit of time on the 19139 schema parsing and editing code in GN 2.1 (and back ported it to GN 2.0.3) as part of the Australian BlueNet marine science metadata project.

This use of substitution groups is one of the many cases GN doesn't deal with - and I know why - because it is a real hair tearer to code! Any rate I've done this (and I'm sure others have too?) and I want to donate the code back to the GN 2.1 beta 4 if the developers will take it.

Here's some of the other problems fixed:

1. GN assumes element names unique (they are if you use short names like GN did with 19115 DIS) which isn't the case with the long names in 19139 eg. gmd:extent and gmd:date - need to put in code to handle duplicate long names by examining parent

2. Abstract elements - skipping through these until you find a concrete element but collecting attributes and elements from any types used.

3. Anonymous <choice> blocks (including nested <choice> blocks) (particularly in the &^%$# gml schema).

4. Attributes with prefixes eg. gml:id

Anyway, I've loaded it into GN 2.1 with the modifications to the schema parsing stuff I've made (xml attached). It doesn't verify because of missing mandatory? content:

<message>Exception in endElement: cvc-complex-type.2.4.b: The content of element 'gmd:resourceConstraints' is not complete. One of '{"http://www.isotc211.org/2005/gmd&quot;:MD\_SecurityConstraints\}' is expected.</message>

But the gmx stuff is parsed and substitutions are accepted so it can be done if you mod schema parser code in GN.

Cheers,
Simon

(attachments)

iso19139.xml (21.8 KB)