Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
wangf1122 committed Feb 20, 2024
1 parent 892a8b4 commit 90f7b0a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
xmlns:gn-fn-rel="http://geonetwork-opensource.org/xsl/functions/relations"
version="2.0"
Expand Down Expand Up @@ -109,7 +109,7 @@
<xsl:value-of select="position()"/>
</idx>
<hash>
<xsl:value-of select="util:md5HexIgnoreWhiteSpaces(string(exslt:node-set(.)))"/>
<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>
</hash>
<url>
<xsl:apply-templates mode="get-iso19139-localized-string"
Expand Down Expand Up @@ -141,7 +141,7 @@
<xsl:value-of select="position()"/>
</idx>
<hash>
<xsl:value-of select="util:md5HexIgnoreWhiteSpaces(string(exslt:node-set(.)))"/>
<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>
</hash>
<title>
<xsl:apply-templates mode="get-iso19139-localized-string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gn-fn-index="http://geonetwork-opensource.org/xsl/functions/index"
xmlns:index="java:org.fao.geonet.kernel.search.EsSearchManager"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
xmlns:date-util="java:org.fao.geonet.utils.DateUtil"
xmlns:daobs="http://daobs.org"
Expand Down Expand Up @@ -1106,7 +1106,7 @@
<atomfeed><xsl:value-of select="gmd:linkage/gmd:URL"/></atomfeed>
</xsl:if>
<link type="object">{
"hash": "<xsl:value-of select="util:md5HexIgnoreWhiteSpaces(string(exslt:node-set(.)))"/>",
"hash": "<xsl:value-of select="digestUtils:md5Hex(string(exslt:node-set(normalize-space(.))))"/>",
"idx": <xsl:value-of select="position()"/>,
"protocol":"<xsl:value-of select="util:escapeForJson((gmd:protocol/*/text())[1])"/>",
"mimeType":"<xsl:value-of select="if (*/gmx:MimeFileType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Note: It assumes that it will be adding new items in
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
exclude-result-prefixes="#all"
version="2.0">
Expand Down Expand Up @@ -193,7 +193,7 @@ Note: It assumes that it will be adding new items in
gmd:CI_OnlineResource/gmd:linkage/gmd:URL,
gmd:CI_OnlineResource/gmd:protocol/*,
gmd:CI_OnlineResource/gmd:name/gco:CharacterString)))
and ($resourceHash = '' or util:md5HexIgnoreWhiteSpaces(string(exslt:node-set(.))) = $resourceHash)]"
and ($resourceHash = '' or digestUtils:md5Hex(string(exslt:node-set(normalize-space(.)))) = $resourceHash)]"
priority="2">
<xsl:call-template name="createOnlineSrc"/>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Stylesheet used to remove a reference to a online resource.
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:util="java:org.fao.geonet.util.XslUtil"
xmlns:digestUtils="java:org.apache.commons.codec.digest.DigestUtils"
xmlns:exslt="http://exslt.org/common"
exclude-result-prefixes="#all"
version="2.0">
Expand Down Expand Up @@ -59,7 +59,7 @@ Stylesheet used to remove a reference to a online resource.
or normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and count(gmd:CI_OnlineResource/gmd:name/gmd:PT_FreeText/gmd:textGroup[gmd:LocalisedCharacterString = $name]) > 0
or normalize-space(gmd:CI_OnlineResource/gmd:linkage/gmd:URL) = $url and normalize-space(gmd:CI_OnlineResource/gmd:protocol/*) = 'WWW:DOWNLOAD-1.0-http--download'))
)
and ($resourceHash = '' or util:md5HexIgnoreWhiteSpaces(string(exslt:node-set(.))) = $resourceHash)]"
and ($resourceHash = '' or digestUtils:md5Hex(string(exslt:node-set(normalize-space(.)))) = $resourceHash)]"
priority="2"/>

<!-- Do a copy of every node and attribute -->
Expand Down

0 comments on commit 90f7b0a

Please sign in to comment.