You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2022/11/22 10:04:27 UTC

[sis] 01/03: Replace "http://standards.iso.org/iso/" hard-coded strings by a constant.

This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 3e1d14f7d6c3f9922d75cb890d4058305a1c8587
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Nov 21 12:17:33 2022 +0100

    Replace "http://standards.iso.org/iso/" hard-coded strings by a constant.
---
 .../apache/sis/internal/jaxb/cat/CodeListUID.java  |  4 +-
 .../internal/metadata/ImplementationHelper.java    |  5 ++
 .../apache/sis/internal/xml/LegacyNamespaces.java  |  4 +-
 .../main/java/org/apache/sis/xml/Namespaces.java   | 78 +++++++++++-----------
 .../constraint/DefaultLegalConstraintsTest.java    |  7 +-
 .../sis/metadata/iso/content/DefaultBandTest.java  |  7 +-
 .../sis/xml/CharSequenceSubstitutionTest.java      |  3 +-
 .../java/org/apache/sis/xml/NamespacesTest.java    |  8 ++-
 8 files changed, 66 insertions(+), 50 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/cat/CodeListUID.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/cat/CodeListUID.java
index 81ca50578d..6a2ca57d21 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/cat/CodeListUID.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/cat/CodeListUID.java
@@ -27,6 +27,8 @@ import org.opengis.util.ControlledVocabulary;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.internal.jaxb.Context;
 
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
+
 
 /**
  * Stores information about {@link CodeList} in order to marshal in the way defined by ISO 19115-3.
@@ -92,7 +94,7 @@ public final class CodeListUID {
      * which seems more stable. The TC 211 repository is used for downloads, while the standard ISO URL is sill
      * used for namespaces.
      */
-    public static final String METADATA_ROOT = "http://standards.iso.org/iso/19115/";
+    public static final String METADATA_ROOT = ISO_NAMESPACE + "19115/";
 
     /**
      * The root directory of OGC metadata schemas.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ImplementationHelper.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ImplementationHelper.java
index 1aacb7af82..417a67c9ef 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ImplementationHelper.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ImplementationHelper.java
@@ -43,6 +43,11 @@ import org.apache.sis.internal.util.CollectionsExt;
  * @module
  */
 public final class ImplementationHelper extends Static {
+    /**
+     * The root directory of ISO namespaces. Value is {@value}.
+     */
+    public static final String ISO_NAMESPACE = "http://standards.iso.org/iso/";
+
     /**
      * Do not allow instantiation of this class.
      */
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/xml/LegacyNamespaces.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/xml/LegacyNamespaces.java
index 3eb1bfe946..096e142295 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/xml/LegacyNamespaces.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/xml/LegacyNamespaces.java
@@ -18,6 +18,8 @@ package org.apache.sis.internal.xml;
 
 import org.apache.sis.util.Version;
 
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
+
 
 /**
  * Legacy XML namespaces, and {@link Version} constants for identifying when those namespaces were used.
@@ -75,7 +77,7 @@ public final class LegacyNamespaces {
      * The <code>{@value}</code> URL.
      * The usual prefix for this namespace is {@code "gmi"}.
      */
-    public static final String GMI = "http://standards.iso.org/iso/19115/-2/gmi/1.0";
+    public static final String GMI = ISO_NAMESPACE + "19115/-2/gmi/1.0";
 
     /**
      * The <code>{@value}</code> URL, used in ISO 19139:2007.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
index e79d289022..332579bcf4 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
@@ -24,6 +24,8 @@ import org.apache.sis.util.Static;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.internal.xml.LegacyNamespaces;
 
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
+
 
 /**
  * Lists some namespaces URLs used by JAXB when (un)marshalling.
@@ -108,7 +110,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String LAN = "http://standards.iso.org/iso/19115/-3/lan/1.0";
+    public static final String LAN = ISO_NAMESPACE + "19115/-3/lan/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -125,7 +127,7 @@ public final class Namespaces extends Static {
      *
      * @category ISO
      */
-    public static final String GCO = "http://standards.iso.org/iso/19115/-3/gco/1.0";
+    public static final String GCO = ISO_NAMESPACE + "19115/-3/gco/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -135,7 +137,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MCC = "http://standards.iso.org/iso/19115/-3/mcc/1.0";
+    public static final String MCC = ISO_NAMESPACE + "19115/-3/mcc/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -145,7 +147,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String FCC = "http://standards.iso.org/iso/19110/fcc/1.0";
+    public static final String FCC = ISO_NAMESPACE + "19110/fcc/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -162,7 +164,7 @@ public final class Namespaces extends Static {
      *
      * @category ISO
      */
-    public static final String GFC = "http://standards.iso.org/iso/19110/gfc/1.1";
+    public static final String GFC = ISO_NAMESPACE + "19110/gfc/1.1";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -172,7 +174,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String CAT = "http://standards.iso.org/iso/19115/-3/cat/1.0";
+    public static final String CAT = ISO_NAMESPACE + "19115/-3/cat/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -182,7 +184,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MDB = "http://standards.iso.org/iso/19115/-3/mdb/1.0";
+    public static final String MDB = ISO_NAMESPACE + "19115/-3/mdb/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -192,7 +194,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String CIT = "http://standards.iso.org/iso/19115/-3/cit/1.0";
+    public static final String CIT = ISO_NAMESPACE + "19115/-3/cit/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -202,7 +204,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String GEX = "http://standards.iso.org/iso/19115/-3/gex/1.0";
+    public static final String GEX = ISO_NAMESPACE + "19115/-3/gex/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -212,7 +214,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MRS = "http://standards.iso.org/iso/19115/-3/mrs/1.0";
+    public static final String MRS = ISO_NAMESPACE + "19115/-3/mrs/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -222,7 +224,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String RCE = "http://standards.iso.org/iso/19111/rce/1.0";
+    public static final String RCE = ISO_NAMESPACE + "19111/rce/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -232,7 +234,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MSR = "http://standards.iso.org/iso/19115/-3/msr/1.0";
+    public static final String MSR = ISO_NAMESPACE + "19115/-3/msr/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -242,7 +244,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MRC = "http://standards.iso.org/iso/19115/-3/mrc/1.0";
+    public static final String MRC = ISO_NAMESPACE + "19115/-3/mrc/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -252,7 +254,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MRI = "http://standards.iso.org/iso/19115/-3/mri/1.0";
+    public static final String MRI = ISO_NAMESPACE + "19115/-3/mri/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -262,7 +264,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MRD = "http://standards.iso.org/iso/19115/-3/mrd/1.0";
+    public static final String MRD = ISO_NAMESPACE + "19115/-3/mrd/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -272,7 +274,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MDT = "http://standards.iso.org/iso/19115/-3/mdt/1.0";
+    public static final String MDT = ISO_NAMESPACE + "19115/-3/mdt/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -282,7 +284,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MCO = "http://standards.iso.org/iso/19115/-3/mco/1.0";
+    public static final String MCO = ISO_NAMESPACE + "19115/-3/mco/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -292,7 +294,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MAC = "http://standards.iso.org/iso/19115/-3/mac/1.0";
+    public static final String MAC = ISO_NAMESPACE + "19115/-3/mac/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -302,7 +304,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MRL = "http://standards.iso.org/iso/19115/-3/mrl/1.0";
+    public static final String MRL = ISO_NAMESPACE + "19115/-3/mrl/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -312,7 +314,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MMI = "http://standards.iso.org/iso/19115/-3/mmi/1.0";
+    public static final String MMI = ISO_NAMESPACE + "19115/-3/mmi/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -322,7 +324,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String DQC = "http://standards.iso.org/iso/19157/-2/dqc/1.0";
+    public static final String DQC = ISO_NAMESPACE + "19157/-2/dqc/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -332,7 +334,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MDQ = "http://standards.iso.org/iso/19157/-2/mdq/1.0";
+    public static final String MDQ = ISO_NAMESPACE + "19157/-2/mdq/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -342,7 +344,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.3
      */
-    public static final String DQM = "http://standards.iso.org/iso/19157/-2/dqm/1.0";
+    public static final String DQM = ISO_NAMESPACE + "19157/-2/dqm/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -352,7 +354,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MDS = "http://standards.iso.org/iso/19115/-3/mds/1.0";
+    public static final String MDS = ISO_NAMESPACE + "19115/-3/mds/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -370,7 +372,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String SRV = "http://standards.iso.org/iso/19115/-3/srv/2.0";
+    public static final String SRV = ISO_NAMESPACE + "19115/-3/srv/2.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -380,7 +382,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MPC = "http://standards.iso.org/iso/19115/-3/mpc/1.0";
+    public static final String MPC = ISO_NAMESPACE + "19115/-3/mpc/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -390,7 +392,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MDA = "http://standards.iso.org/iso/19115/-3/mda/1.0";
+    public static final String MDA = ISO_NAMESPACE + "19115/-3/mda/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -400,7 +402,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MAS = "http://standards.iso.org/iso/19115/-3/mas/1.0";
+    public static final String MAS = ISO_NAMESPACE + "19115/-3/mas/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -410,7 +412,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MEX = "http://standards.iso.org/iso/19115/-3/mex/1.0";
+    public static final String MEX = ISO_NAMESPACE + "19115/-3/mex/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -420,7 +422,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String GCX = "http://standards.iso.org/iso/19115/-3/gcx/1.0";
+    public static final String GCX = ISO_NAMESPACE + "19115/-3/gcx/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -430,7 +432,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MD1 = "http://standards.iso.org/iso/19115/-3/md1/1.0";
+    public static final String MD1 = ISO_NAMESPACE + "19115/-3/md1/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -440,7 +442,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String MD2 = "http://standards.iso.org/iso/19115/-3/md2/1.0";
+    public static final String MD2 = ISO_NAMESPACE + "19115/-3/md2/1.0";
 
     /**
      * The <code>{@value}</code> URL. This is the namespace of
@@ -450,7 +452,7 @@ public final class Namespaces extends Static {
      * @category ISO
      * @since 1.0
      */
-    public static final String GMW = "http://standards.iso.org/iso/19115/-3/gmw/1.0";
+    public static final String GMW = ISO_NAMESPACE + "19115/-3/gmw/1.0";
 
     /**
      * The <code>{@value}</code> URL.
@@ -519,11 +521,11 @@ public final class Namespaces extends Static {
      * URLs for which the XML prefix to use directly follows an URL starts given in this array.
      */
     private static final String[] GENERIC_URLS = {
-        "http://standards.iso.org/iso/19115/-3/",
-        "http://standards.iso.org/iso/19115/-2/",
-        "http://standards.iso.org/iso/19157/-2/",
-        "http://standards.iso.org/iso/19111/",
-        "http://standards.iso.org/iso/19110/",
+        ISO_NAMESPACE + "19115/-3/",
+        ISO_NAMESPACE + "19115/-2/",
+        ISO_NAMESPACE + "19157/-2/",
+        ISO_NAMESPACE + "19111/",
+        ISO_NAMESPACE + "19110/",
         "http://www.isotc211.org/2005/",
         "http://www.opengis.net/",
         "http://www.w3.org/1999/",
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
index 6708b61fed..58012543f8 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
@@ -26,6 +26,7 @@ import org.junit.Test;
 import static java.util.Collections.singleton;
 import static org.apache.sis.test.MetadataAssert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
 
 
 /**
@@ -51,10 +52,10 @@ public final strictfp class DefaultLegalConstraintsTest extends TestCase {
         final DefaultLegalConstraints c = unmarshal(DefaultLegalConstraints.class,
                 "<mco:MD_LegalConstraints xmlns:mco=\"" + Namespaces.MCO + "\">\n" +
                 "  <mco:accessConstraints>\n" +
-                "    <mco:MD_RestrictionCode codeListValue=\"intellectualPropertyRights\" codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\"/>\n" +
+                "    <mco:MD_RestrictionCode codeListValue=\"intellectualPropertyRights\" codeList=\"" + ISO_NAMESPACE + "19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\"/>\n" +
                 "  </mco:accessConstraints>\n" +
                 "  <mco:useConstraints>\n" +            // Below is an intentionally empty code list value (SIS-157)
-                "    <mco:MD_RestrictionCode codeListValue=\"\" codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\"/>\n" +
+                "    <mco:MD_RestrictionCode codeListValue=\"\" codeList=\"" + ISO_NAMESPACE + "19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\"/>\n" +
                 "  </mco:useConstraints>\n" +
                 "</mco:MD_LegalConstraints>");
         /*
@@ -77,7 +78,7 @@ public final strictfp class DefaultLegalConstraintsTest extends TestCase {
                 "<mco:MD_LegalConstraints xmlns:mco=\"" + Namespaces.MCO + "\">\n" +
                 "  <mco:useConstraints>\n" +
                 "    <mco:MD_RestrictionCode"
-                        + " codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\""
+                        + " codeList=\"" + ISO_NAMESPACE + "19115/resources/Codelist/cat/codelists.xml#MD_RestrictionCode\""
                         + " codeListValue=\"licence\""
                         + " codeSpace=\"eng\">Licence</mco:MD_RestrictionCode>\n" +
                 "  </mco:useConstraints>\n" +
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/content/DefaultBandTest.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/content/DefaultBandTest.java
index b359fa5bea..8f224645f6 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/content/DefaultBandTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/content/DefaultBandTest.java
@@ -23,6 +23,7 @@ import org.apache.sis.test.xml.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.MetadataAssert.*;
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
 
 
 /**
@@ -38,7 +39,7 @@ public final strictfp class DefaultBandTest extends TestCase {
      * The XML fragment used for testing.
      */
     private static final String XML =
-              "<mrc:MI_Band xmlns:mrc=\"http://standards.iso.org/iso/19115/-3/mrc/1.0\" xmlns:gco=\"http://standards.iso.org/iso/19115/-3/gco/1.0\">\n"
+              "<mrc:MI_Band xmlns:mrc=\"" + ISO_NAMESPACE + "19115/-3/mrc/1.0\" xmlns:gco=\"" + ISO_NAMESPACE +  "19115/-3/gco/1.0\">\n"
             + "  <mrc:numberOfValues>\n"
             + "    <gco:Integer>1000</gco:Integer>\n"       // Only in 2014 schema.
             + "  </mrc:numberOfValues>\n"
@@ -47,7 +48,7 @@ public final strictfp class DefaultBandTest extends TestCase {
             + "  </mrc:nominalSpatialResolution>\n"
             + "  <mrc:detectedPolarisation>\n"
             + "    <mrc:MI_PolarisationOrientationCode "    // Spell with "s" in 2014 schema.
-            +       "codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MI_PolarisationOrientationCode\" codeListValue=\"vertical\">"
+            +       "codeList=\"" + ISO_NAMESPACE + "19115/resources/Codelist/cat/codelists.xml#MI_PolarisationOrientationCode\" codeListValue=\"vertical\">"
             +       "Vertical"
             +     "</mrc:MI_PolarisationOrientationCode>\n"
             + "  </mrc:detectedPolarisation>\n"
@@ -59,7 +60,7 @@ public final strictfp class DefaultBandTest extends TestCase {
      * that the legacy spelling is handled when (un)marshalling a legacy document.
      */
     private static final String XML_LEGACY =
-              "<gmi:MI_Band xmlns:gmi=\"http://standards.iso.org/iso/19115/-2/gmi/1.0\" xmlns:gco=\"http://www.isotc211.org/2005/gco\">\n"
+              "<gmi:MI_Band xmlns:gmi=\"" + ISO_NAMESPACE + "19115/-2/gmi/1.0\" xmlns:gco=\"http://www.isotc211.org/2005/gco\">\n"
             + "  <gmi:nominalSpatialResolution>\n"
             + "    <gco:Real>10.0</gco:Real>\n"
             + "  </gmi:nominalSpatialResolution>\n"
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java b/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java
index 3d02984e4c..78ab9b08b2 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java
@@ -31,6 +31,7 @@ import org.apache.sis.test.xml.TestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.MetadataAssert.*;
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
 
 
 /**
@@ -163,7 +164,7 @@ public final strictfp class CharSequenceSubstitutionTest extends TestCase {
                 "<mri:MD_DataIdentification xmlns:mri=\"" + Namespaces.MRI + "\">\n" +
                 "  <mri:purpose>\n" +
                 "    <mri:DS_InitiativeTypeCode\n" +
-                "        codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#DS_InitiativeTypeCode\"\n" +
+                "        codeList=\"" + ISO_NAMESPACE + "19115/resources/Codelist/cat/codelists.xml#DS_InitiativeTypeCode\"\n" +
                 "        codeListValue=\"investigation\">Investigation</mri:DS_InitiativeTypeCode>\n" +
                 "  </mri:purpose>\n" +
                 "</mri:MD_DataIdentification>";
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/xml/NamespacesTest.java b/core/sis-metadata/src/test/java/org/apache/sis/xml/NamespacesTest.java
index c01cc79295..c9b7d176e3 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/xml/NamespacesTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/xml/NamespacesTest.java
@@ -21,6 +21,8 @@ import org.junit.Test;
 
 import static org.junit.Assert.*;
 
+import static org.apache.sis.internal.metadata.ImplementationHelper.ISO_NAMESPACE;
+
 
 /**
  * Tests the {@link Namespaces} class.
@@ -37,9 +39,9 @@ public final strictfp class NamespacesTest extends TestCase {
     @Test
     public void testGetPreferredPrefix() {
         assertEquals("gml",  Namespaces.getPreferredPrefix("http://www.opengis.net/gml/3.2", null));
-        assertEquals("mdb",  Namespaces.getPreferredPrefix("http://standards.iso.org/iso/19115/-3/mdb/1.0", null));
-        assertEquals("gmi",  Namespaces.getPreferredPrefix("http://standards.iso.org/iso/19115/-2/gmi/1.0", null));
-        assertEquals("srv",  Namespaces.getPreferredPrefix("http://standards.iso.org/iso/19115/-3/srv/2.0", null));
+        assertEquals("mdb",  Namespaces.getPreferredPrefix(ISO_NAMESPACE + "19115/-3/mdb/1.0", null));
+        assertEquals("gmi",  Namespaces.getPreferredPrefix(ISO_NAMESPACE + "19115/-2/gmi/1.0", null));
+        assertEquals("srv",  Namespaces.getPreferredPrefix(ISO_NAMESPACE + "19115/-3/srv/2.0", null));
         assertEquals("srv1", Namespaces.getPreferredPrefix("http://www.isotc211.org/2005/srv", null));
         assertEquals("gmd",  Namespaces.getPreferredPrefix("http://www.isotc211.org/2005/gmd", null));
     }