Skip to content

Commit

Permalink
Schematron / Avoid matching of elements part of the schematron report (
Browse files Browse the repository at this point in the history
…#3624)

Don't let iso schematron provide processable entries to form builder by avoiding searching elements children of the schematron report in getOriginalNode.

A better fix would be in schematron files, select text or attribute and not node.
```
gmd:CI_ResponsibleParty/gmd:organisationName
```
replace by
```
gmd:CI_ResponsibleParty/gmd:organisationName/*/text()
```

Something to apply to new schematron rules and to existing but that requires quite some work in all schematrons.
  • Loading branch information
cmangeat authored and fxprunayre committed May 14, 2019
1 parent 710ab2c commit 603781d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/main/webapp/xslt/common/functions-metadata.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gn="http://www.fao.org/geonetwork" xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata"
xmlns:gn="http://www.fao.org/geonetwork"
xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata"
xmlns:saxon="http://saxon.sf.net/"
version="2.0" extension-element-prefixes="saxon"
exclude-result-prefixes="#all">
Expand All @@ -42,7 +44,7 @@
<xsl:param name="evaluatedNode" as="node()"/>

<xsl:variable name="nodeRef" select="$evaluatedNode/gn:element/@ref"/>
<xsl:variable name="node" select="$metadata//*[gn:element/@ref = $nodeRef]"/>
<xsl:variable name="node" select="$metadata//*[gn:element/@ref = $nodeRef][not(ancestor::svrl:*)]"/>

<!--<xsl:message>#getOriginalNode ==================</xsl:message>
<xsl:message><xsl:value-of select="$evaluatedNode/*/gn:element/@ref"/></xsl:message>
Expand Down

0 comments on commit 603781d

Please sign in to comment.