[GeoNetwork-users] FGDC -> ISO19115 stylesheet problems

Hello,

I am new to Geonetwork and am very impressed by what I've seen so far. My project involves creation of a metadata catalogue for British Antarctic Survey's holdings of remote sensing images and aerial photography. Geonetwork looks very suited to this purpose. Our main requirement is that our metadata should conform to ISO 19115. Looking at the range of XML metadata files we have associated with our satellite imagery, I am successfully able to import the ones in ESRI proprietary formats using one of the existing XSLT stylesheets under Administration->Metadata insert. The ones giving me trouble at the moment are ones already in FGDC format, which import effortlessly but result in something not ISO 19115 compliant. As far as I can see, none of the standard XSLT stylesheets bundled with Geonetwork "out of the box" address the transformation FGDC -> ISO 19115. Scouting around, I found a set of transformations at:

http://www.ncddc.noaa.gov/metadataresource/metadataandxml

(under link "FGDC CSDGM to ISO Transforms").

I plugged this into Geonetwork (file FGDCtoISO19115.xsl) and am able to select it from the admin interface and attempt to apply it to a sample metadata XML file. Unfortunately I get several errors which I am not sure where to look to track down where they're happening. BTW it would be good if some kind of error message came up within the web page when an import goes wrong. At the moment (for me at least) nothing happens, and I have to look in the Jetty log.

Here is the output from the log, showing (I think) that the XSLT file is there and an attempt was made to apply it to the input metadata file. I did have to fix a couple of typos in the file I downloaded from NOAA concerning the n: namespace - there are a couple of entries which someone forgot to change to gml: I think. However there are still a few XPATH errors on lines like:

<gco:Integer>
  <xsl:sequence select="xs:string(xs:integer(xs:positiveInteger(.)))"/>
</gco:Integer>

With several nesting levels. Are they happening because of errors in the XSLT, or is the XSLT code ok and Geonetwork is using a processor that doesn't support some of the constructs in the stylesheet? I only have limited experience of XSLT so I'm unsure at this point.

I hope someone is able to help with this. I've attached the metadata file I'm using (22.5k) hope that's ok.

Thanks in advance,

David Herbert
British Antarctic Survey.

Errors from Jetty follow:

===========================
1357532 [30066395@anonymised.com] INFO jeeves.request - HTML Request (from 127.0.0.1) :
/geonetwork/srv/en/mef.import
1357532 [30066395@anonymised.com] DEBUG jeeves.request - Method : POST
1357532 [30066395@anonymised.com] DEBUG jeeves.request - Content type : multipart/form-
data; boundary=---------------------------301911800711337
1357532 [30066395@anonymised.com] DEBUG jeeves.request - Accept : text/html,appli
cation/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
1357532 [30066395@anonymised.com] DEBUG jeeves.request - Session id is 17w8z7rnef60o
1357547 [30066395@anonymised.com] DEBUG jeeves.request - Uploading file E146_RGB_321_RE
F.xml type: text/xml size: 23080
1357547 [30066395@anonymised.com] DEBUG jeeves.request - File is called E146_RGB_321_RE
F.xml after simplification
1357547 [30066395@anonymised.com] DEBUG jeeves.request - Adding to parameters: <mefFile
type="file" size="23080" content-type="text/xml">E146_RGB_321_REF.xml</mefFile>

1357547 [30066395@anonymised.com] INFO jeeves.service - Dispatching : mef.import
1357547 [30066395@anonymised.com] DEBUG jeeves.service - -> parameters are :
<params>
  <insert_mode>1</insert_mode>
  <file_type>single</file_type>
  <data />
  <mefFile type="file" size="23080" content-type="text/xml">E146_RGB_321_REF.xml
</mefFile>
  <template>n</template>
  <title />
  <uuidAction>nothing</uuidAction>
  <styleSheet>FGDCtoISO19115.xsl</styleSheet>
  <group>2</group>
  <category>1</category>
</params>
Error at xsl:sequence on line 1014 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 42 on line 1014 in {...nteger(xs:positive
Integer(....}:
    The type xs:positiveInteger is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 1039 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 42 on line 1039 in {...nteger(xs:positive
Integer(....}:
    The type xs:positiveInteger is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 1064 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 42 on line 1064 in {...nteger(xs:positive
Integer(....}:
    The type xs:positiveInteger is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 1102 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 21 on line 1102 in {xs:string(xs:token(.)
)}:
    The type xs:token is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 3744 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 21 on line 3744 in {xs:string(xs:token(.)
)}:
    The type xs:token is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 3751 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 21 on line 3751 in {xs:string(xs:token(.)
)}:
    The type xs:token is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 3756 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 21 on line 3756 in {xs:string(xs:token(.)
)}:
    The type xs:token is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 3949 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 21 on line 3949 in {xs:string(xs:token(.)
)}:
    The type xs:token is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 4549 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 44 on line 4549 in {...($var1236_cond_res
ult_exist...}:
    The type xs:ID is not recognized by a Basic XSLT Processor.
Error at xsl:sequence on line 4598 of file:/C:/Program%20Files/geonetwork/web/ge
onetwork/xsl/conversion/FGDCtoISO19115/MappingMapTogmd.xslt:
  XPST0080: XPath syntax error at char 44 on line 4598 in {...($var1243_cond_res
ult_exist...}:
    The type xs:ID is not recognized by a Basic XSLT Processor.
1359063 [30066395@anonymised.com] ERROR jeeves.service - Exception when executing servi
ce
1359063 [30066395@anonymised.com] ERROR jeeves.service - (C) Exc : javax.xml.transform
.TransformerConfigurationException: Failed to compile stylesheet. 10 errors dete
cted.
1359063 [30066395@anonymised.com] DEBUG jeeves.service - Raised exception while executi
ng service
<error id="error">
  <message>Failed to compile stylesheet. 10 errors detected.</message>
  <class>TransformerConfigurationException</class>
  <stack>
    <at class="net.sf.saxon.PreparedStylesheet" file="PreparedStylesheet.java" l
ine="176" method="prepare" />
    <at class="net.sf.saxon.TransformerFactoryImpl" file="TransformerFactoryImpl
.java" line="139" method="newTemplates" />
    <at class="de.fzi.dbs.xml.transform.CachingTransformerFactory" file="Caching
TransformerFactory.java" line="115" method="newTransformer" />
    <at class="de.fzi.dbs.xml.transform.CachingTransformerFactory" file="Caching
TransformerFactory.java" line="70" method="newTransformer" />
    <at class="jeeves.utils.Xml" file="Xml.java" line="237" method="transform" /

    <at class="jeeves.utils.Xml" file="Xml.java" line="184" method="transform" /

    <at class="org.fao.geonet.kernel.mef.Importer$1" file="Importer.java" line="
136" method="handleInfo" />
    <at class="org.fao.geonet.kernel.mef.XMLFileVisitor" file="XMLFileVisitor.ja
va" line="59" method="handleXml" />
    <at class="org.fao.geonet.kernel.mef.XMLFileVisitor" file="XMLFileVisitor.ja
va" line="41" method="visit" />
    <at class="org.fao.geonet.kernel.mef.MEFLib" file="MEFLib.java" line="62" me
thod="visit" />
  </stack>
  <request>
    <language>en</language>
    <service>mef.import</service>
  </request>
</error>
1359078 [30066395@anonymised.com] INFO jeeves.service - -> dispatching to error for
: mef.import
1359094 [30066395@anonymised.com] INFO jeeves.service - -> transforming with style
sheet : C:\Program Files\geonetwork\web\geonetwork/xsl/error.xsl
Recoverable error
  XTRE0540: Ambiguous rule match for /
Matches both "document-node()" on line 9 of
  file:/C:/Program%20Files/geonetwork/web/geonetwork/xsl/res.xsl
and "document-node()" on line 11 of file:/C:/Program%20Files/geonetwork/web/geon
etwork/xsl/main.xsl
1359203 [30066395@anonymised.com] INFO jeeves.service - -> end error transformatio
n for : mef.import
1359203 [30066395@anonymised.com] INFO jeeves.service - -> error ended for : mef.imp
ort

(attachments)

E146_RGB_321_REF.xml (22.5 KB)