Opened 11 years ago

Last modified 11 years ago

#1238 new defect

generated schematron scontain attributes without name yielding errors in the validator

Reported by: landry Owned by: geonetwork-devel@…
Priority: major Milestone: v2.10.0 RC0
Component: General Version: v2.8.0
Keywords: Cc:

Description

Symptoms are WARNING: schematron xslt /data/webapps/geonetwork/2.8.0/dev/config/schema_plugins/iso19139/schematron-rules-geonetwork.xsl failed (and the same on schematron-rules-iso.xsl).

This yields error in catalina.out in org.fao.geonet.kernel.DataManager.getSchemaTronXmlReport(DataManager.java:876)

Error at xsl:attribute on line 384 column 16 of schematron-rules-iso.xsl:
  XTSE0010: Element must have a "name" attribute
Error at xsl:attribute on line 391 column 16 of schematron-rules-iso.xsl:
  XTSE0010: Element must have a "name" attribute
Error at xsl:attribute on line 394 column 16 of schematron-rules-iso.xsl:
  XTSE0010: Element must have a "name" attribute

In turn the validation window shows 'Schematron error ocurred, rules could not be verified: Failed to compile stylesheet. 46 errors detected.' (for -geonetwork.xsl it's only 2 errors)

Looking at the generated file in schematrons/.build/schematron-rules-geonetwork.xsl (smaller amount of errors than -iso)

<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:active-pattern>
<xsl:attribute>
<value-of/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of/>
</xsl:attribute>

the xsl:attribute tags have no 'name' attribute, thus yielding this warning.

As i dont really understand how this section comes from iso_svrl_for_xslt2.xsl ( the process-pattern template ? ) i'll let it to someone who knows this part to explain it.

Or noone can reproduce that ? Or it's dependent on some version of a processor at some point ?

Change History (1)

comment:1 by landry, 11 years ago

Note that if i manually set the attribute name to 'none' and do 'save and validate' there's no validation error shown to the user, but the following is shown the datamanager debug log :

  <geonet:report geonet:rule="schematron-rules-geonetwork">
    <svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:schold="http://www.ascc.net/xml/schematron" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:iso="http://purl.oclc.org/dsdl/schematron" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:gml="http://www.opengis.net/gml" title="Schematron validation / GeoNetwork recommendations" schemaVersion="">
      <!--  ?
                  ?
                  ?
                 -->
      <svrl:ns-prefix-in-attribute-values />
      <svrl:ns-prefix-in-attribute-values />
      <svrl:ns-prefix-in-attribute-values />
      <svrl:ns-prefix-in-attribute-values />
      <svrl:ns-prefix-in-attribute-values />
      <svrl:ns-prefix-in-attribute-values />
      <svrl:active-pattern none="" />
    </svrl:schematron-output>
  </geonet:report>

The three ? ? ? seem to come from utf-8 chars

./.build/schematron-rules-geonetwork.xsl: <xsl:value-of select="$archiveDirParameter"/>  Â|
./resources/iso_svrl_for_xslt2.xsl:              <axsl:comment><axsl:value-of select="$archiveDirParameter"/>  &#xA0;

And the rest of the message sounds like if the full following section wasnt supposed to be here.

<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:ns-prefix-in-attribute-values/>
<svrl:active-pattern>
<xsl:attribute name="none">
<value-of/>
</xsl:attribute>
<xsl:attribute name="none">
<xsl:value-of/>
</xsl:attribute>
<xsl:apply-templates/>
</svrl:active-pattern>

I can comment it out completely, no errors are shown anymore - but i'd just like to ensure this is a real bug.

Note: See TracTickets for help on using tickets.