sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1822011 - in /sis/branches/ISO-19115-3/core: sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/ sis-metadata/src/test/java/org/apache/sis/metadata/iso/ sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/ sis-metadat...
Date Tue, 23 Jan 2018 14:56:31 GMT
Author: desruisseaux
Date: Tue Jan 23 14:56:31 2018
New Revision: 1822011

URL: http://svn.apache.org/viewvc?rev=1822011&view=rev
Log:
Review the version constants to be kept. Update documentation related to metadata versions.

Modified:
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/EnumMarshallingTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/MarshallingTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultResponsibilityTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
    sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java
    sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
    sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -111,7 +111,7 @@ public final strictfp class CodeListMars
          * Use the convenience method in order to avoid the effort of creating
          * our own MarshallerPool.
          */
-        final String actual = marshal(rp, LegacyNamespaces.ISO_19139);
+        final String actual = marshal(rp, VERSION_2007);
         assertXmlEquals(expected, actual, "xmlns:*");
     }
 
@@ -128,7 +128,7 @@ public final strictfp class CodeListMars
 
         final MarshallerPool pool = getMarshallerPool();
         final Marshaller marshaller = pool.acquireMarshaller();
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         marshaller.setProperty(XML.SCHEMAS, Collections.singletonMap("gmd",
                 "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas"));     // Intentionally omit trailing '/'.
         final String actual = marshal(marshaller, rp);
@@ -166,7 +166,7 @@ public final strictfp class CodeListMars
         final MarshallerPool pool = getMarshallerPool();
         final Marshaller marshaller = pool.acquireMarshaller();
         if (legacy) {
-            marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+            marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         }
         /*
          * First, test using the French locale.

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/EnumMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/EnumMarshallingTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/EnumMarshallingTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/EnumMarshallingTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -22,7 +22,6 @@ import java.util.Collection;
 import javax.xml.bind.JAXBException;
 import org.opengis.metadata.identification.TopicCategory;
 import org.apache.sis.metadata.iso.identification.DefaultDataIdentification;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
@@ -67,7 +66,7 @@ public final strictfp class EnumMarshall
                 "  </mri:topicCategory>\n" +
                 "</mri:MD_DataIdentification>";
 
-        final String xml = marshal(id, LegacyNamespaces.ISO_19115_3);
+        final String xml = marshal(id, VERSION_2014);
         assertXmlEquals(expected, xml, "xmlns:*");
         /*
          * Unmarshall the above XML and verify that we find all the topic categories.

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -21,7 +21,6 @@ import java.util.Locale;
 import javax.xml.bind.JAXBException;
 import org.apache.sis.util.Version;
 import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
@@ -72,7 +71,7 @@ public final strictfp class PT_LocaleTes
      */
     @Test
     public void testMarshalling() throws JAXBException {
-        marshalAndCompare("Locales.xml", LegacyNamespaces.ISO_19115_3,
+        marshalAndCompare("Locales.xml", VERSION_2014,
                           "mdb:contact", "mdb:dateInfo", "mdb:identificationInfo");
     }
 
@@ -83,7 +82,7 @@ public final strictfp class PT_LocaleTes
      */
     @Test
     public void testMarshallingLegacy() throws JAXBException {
-        marshalAndCompare("Locales (legacy).xml", LegacyNamespaces.ISO_19139,
+        marshalAndCompare("Locales (legacy).xml", VERSION_2007,
                           "gmd:contact", "gmd:dateStamp", "gmd:identificationInfo");
     }
 

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -186,7 +186,7 @@ public final strictfp class ImmutableIde
                 "    <gco:CharacterString>4326</gco:CharacterString>\n" +
                 "  </gmd:code>\n" +
                 "</gmd:RS_Identifier>",
-                marshal(identifier, LegacyNamespaces.ISO_19139), "xmlns:*");
+                marshal(identifier, VERSION_2007), "xmlns:*");
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/MarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/MarshallingTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/MarshallingTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/MarshallingTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -56,7 +56,6 @@ import org.apache.sis.measure.Units;
 import org.apache.sis.xml.XML;
 import org.apache.sis.xml.MarshallerPool;
 import org.apache.sis.internal.jaxb.gmx.Anchor;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.metadata.replace.ReferenceSystemMetadata;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
@@ -459,7 +458,7 @@ public final class MarshallingTest exten
     @Test
     public void testLegacySchema() throws URISyntaxException, JAXBException {
         final DefaultMetadata md = metadata();
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         marshaller.marshal(md, output);
         recycle();
     }
@@ -473,7 +472,7 @@ public final class MarshallingTest exten
     @Test
     public void testCurrentSchema() throws JAXBException, URISyntaxException {
         final DefaultMetadata md = metadata();
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19115_3);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2014);
         marshaller.marshal(md, output);
         recycle();
     }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -33,7 +33,6 @@ import org.opengis.metadata.citation.Res
 import org.opengis.metadata.citation.OnLineFunction;
 import org.opengis.metadata.citation.PresentationForm;
 import org.apache.sis.internal.util.CollectionsExt;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.xml.IdentifierMap;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.metadata.iso.extent.Extents;
@@ -194,7 +193,7 @@ public final strictfp class DefaultCitat
      */
     @Test
     public void testMarshalling() throws JAXBException {
-        testMarshalling(XML_FILE, LegacyNamespaces.ISO_19115_3);
+        testMarshalling(XML_FILE, VERSION_2014);
     }
 
     /**
@@ -208,7 +207,7 @@ public final strictfp class DefaultCitat
     @Test
     @DependsOnMethod("testMarshalling")
     public void testMarshallingLegacy() throws JAXBException {
-        testMarshalling(XML_FILE_LEGACY, LegacyNamespaces.ISO_19139);
+        testMarshalling(XML_FILE_LEGACY, VERSION_2007);
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultResponsibilityTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultResponsibilityTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultResponsibilityTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultResponsibilityTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -47,7 +47,7 @@ public final strictfp class DefaultRespo
         final DefaultResponsibility  r = new DefaultResponsibility(Role.AUTHOR, null, party);
         final DefaultCitation citation = new DefaultCitation();
         citation.setCitedResponsibleParties(singleton(r));
-        final String xml = marshal(citation, LegacyNamespaces.ISO_19139);
+        final String xml = marshal(citation, VERSION_2007);
         assertXmlEquals("<gmd:CI_Citation xmlns:gco=\"" + LegacyNamespaces.GCO + '"' +
                                         " xmlns:gmd=\"" + LegacyNamespaces.GMD + "\">\n" +
                 "  <gmd:citedResponsibleParty>\n" +

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -162,7 +162,7 @@ public final strictfp class DefaultLegal
                 "  </gmd:useConstraints>\n" +
                 "</gmd:MD_LegalConstraints>\n";
 
-        assertXmlEquals(xml, marshal(c, LegacyNamespaces.ISO_19139), "xmlns:*");
+        assertXmlEquals(xml, marshal(c, VERSION_2007), "xmlns:*");
         actual = unmarshal(xml);
         assertSame(Restriction.LICENCE, getSingleton(actual.getUseConstraints()));
         assertEquals(c, actual);

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -22,7 +22,6 @@ import javax.xml.bind.JAXBException;
 import org.opengis.metadata.extent.Extent;
 import org.apache.sis.util.Version;
 import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.NilObject;
@@ -105,7 +104,7 @@ public final strictfp class DefaultExten
      */
     @Test
     public void testXML() throws JAXBException {
-        roundtrip("Extent.xml", LegacyNamespaces.ISO_19115_3);
+        roundtrip("Extent.xml", VERSION_2014);
     }
 
     /**
@@ -115,7 +114,7 @@ public final strictfp class DefaultExten
      */
     @Test
     public void testLegacyXML() throws JAXBException {
-        roundtrip("Extent (legacy).xml", LegacyNamespaces.ISO_19139);
+        roundtrip("Extent (legacy).xml", VERSION_2007);
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultBrowseGraphicTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -23,7 +23,6 @@ import javax.xml.bind.Marshaller;
 import javax.xml.bind.JAXBException;
 import javax.xml.transform.stream.StreamSource;
 import org.opengis.metadata.identification.BrowseGraphic;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.Version;
@@ -63,9 +62,9 @@ public final strictfp class DefaultBrows
         final Version version;
         if (legacy) {
             expected = toLegacyXML(expected);
-            version  = LegacyNamespaces.ISO_19139;
+            version  = VERSION_2007;
         } else {
-            version  = LegacyNamespaces.ISO_19115_3;
+            version  = VERSION_2014;
         }
         actual = marshal(browse, version);
         assertXmlEquals(expected, actual, "xmlns:*");

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -20,7 +20,6 @@ import javax.xml.bind.JAXBException;
 import org.opengis.metadata.identification.RepresentativeFraction;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.IdentifierSpace;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.util.Version;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOnMethod;
@@ -54,9 +53,9 @@ public final strictfp class DefaultRepre
         final Version version;
         if (legacy) {
             expected = toLegacyXML(expected);
-            version  = LegacyNamespaces.ISO_19139;
+            version  = VERSION_2007;
         } else {
-            version  = LegacyNamespaces.ISO_19115_3;
+            version  = VERSION_2014;
         }
         actual = marshal(browse, version);
         assertXmlEquals(expected, actual, "xmlns:*");

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultResolutionTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -152,7 +152,7 @@ public final strictfp class DefaultResol
     public void testLegacyXML() throws JAXBException {
         final DefaultResolution resolution = new DefaultResolution();
         resolution.setDistance(1000.0);
-        final String xml = marshal(resolution, LegacyNamespaces.ISO_19139);
+        final String xml = marshal(resolution, VERSION_2007);
         assertXmlEquals(
                 "<gmd:MD_Resolution xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' +
                                   " xmlns:gco=\"" + LegacyNamespaces.GCO + "\">\n" +

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -28,7 +28,6 @@ import org.opengis.metadata.identificati
 import org.opengis.metadata.identification.DistributedComputingPlatform;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.xml.NilReason;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.XMLTestCase;
@@ -126,7 +125,7 @@ public final strictfp class DefaultServi
      */
     @Test
     public void testMarshalLegacy() throws JAXBException {
-        assertMarshalEqualsFile(XML_FILE_LEGACY, create(), LegacyNamespaces.ISO_19139, "xlmns:*", "xsi:schemaLocation");
+        assertMarshalEqualsFile(XML_FILE_LEGACY, create(), VERSION_2007, "xlmns:*", "xsi:schemaLocation");
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -53,7 +53,7 @@ public final strictfp class DefaultLinea
          * If this simpler case, only ISO 19115 elements are defined (no ISO 19115-2).
          * Consequently the XML name shall be "gmd:LI_Source".
          */
-        String actual = marshal(lineage, LegacyNamespaces.ISO_19139);
+        String actual = marshal(lineage, VERSION_2007);
         assertXmlEquals(
             "<gmd:LI_Lineage xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' +
                            " xmlns:gco=\"" + LegacyNamespaces.GCO + "\">\n" +
@@ -69,7 +69,7 @@ public final strictfp class DefaultLinea
          * Now add a ISO 19115-2 specific property. The XML name shall become "gmi:LE_Source".
          */
         source.setProcessedLevel(new DefaultIdentifier("DummyLevel"));
-        actual = marshal(lineage, LegacyNamespaces.ISO_19139);
+        actual = marshal(lineage, VERSION_2007);
         assertXmlEquals(
             "<gmd:LI_Lineage xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' +
                            " xmlns:gmi=\"" + LegacyNamespaces.GMI + '"' +

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -19,7 +19,6 @@ package org.apache.sis.metadata.iso.line
 import javax.xml.bind.JAXBException;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.internal.jaxb.gmi.LE_ProcessStep;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
@@ -58,7 +57,7 @@ public final strictfp class DefaultProce
         /*
          * XML marshalling, and compare with the content of "ProcessStep.xml" file.
          */
-        assertMarshalEqualsFile(XML_FILE, processStep, LegacyNamespaces.ISO_19139, "xlmns:*", "xsi:schemaLocation");
+        assertMarshalEqualsFile(XML_FILE, processStep, VERSION_2007, "xlmns:*", "xsi:schemaLocation");
         /*
          * XML unmarshalling: ensure that we didn't lost any information.
          * Note that since the XML uses the <gmi:…> namespace, we got an instance of LE_ProcessStep, which

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -20,7 +20,6 @@ import java.util.Locale;
 import javax.xml.bind.JAXBException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.xml.FreeTextMarshallingTest;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.util.Version;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
@@ -57,7 +56,7 @@ public final strictfp class AbstractPosi
      */
     @Test
     public void testXML() throws JAXBException {
-        roundtrip("PositionalAccuracy.xml", LegacyNamespaces.ISO_19115_3);
+        roundtrip("PositionalAccuracy.xml", VERSION_2014);
     }
 
     /**
@@ -67,7 +66,7 @@ public final strictfp class AbstractPosi
      */
     @Test
     public void testLegacyXML() throws JAXBException {
-        roundtrip("PositionalAccuracy (legacy).xml", LegacyNamespaces.ISO_19139);
+        roundtrip("PositionalAccuracy (legacy).xml", VERSION_2007);
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/Context.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -234,7 +234,7 @@ public final class Context extends Marsh
                    final ValueConverter     converter,
                    final WarningListener<?> warningListener)
     {
-        if (versionMetadata != null && versionMetadata.compareTo(LegacyNamespaces.ISO_19115_3) < 0) {
+        if (versionMetadata != null && versionMetadata.compareTo(LegacyNamespaces.VERSION_2014) < 0) {
             bitMasks |= LEGACY_METADATA;
         }
         this.locales           = new LinkedList<>();
@@ -292,10 +292,14 @@ public final class Context extends Marsh
      */
     @Override
     public final Version getVersion(final String prefix) {
-        if (prefix.equals("gml")) {
-            return versionGML;
+        switch (prefix) {
+            case "gml": return versionGML;
+            case "gmd": {
+                if ((bitMasks & MARSHALLING) == 0) break;   // If unmarshalling, we don't know the version.
+                return new Version((bitMasks & LEGACY_METADATA) != 0 ? "2007" : "2016");
+            }
+            // Future SIS versions may add more cases here.
         }
-        // Future SIS versions may add more cases here.
         return null;
     }
 

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/LegacyNamespaces.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -33,14 +33,12 @@ import org.apache.sis.util.Version;
  */
 public final class LegacyNamespaces {
     /**
-     * @deprecated to be replaced by {@code VERSION_1_0}, which is the version declared in XML schemas.
+     * Miscellaneous version constants used for ISO standards.
      */
-    @Deprecated
-    public static final Version ISO_19115_3 = new Version("2014"),
-                                ISO_19139   = new Version("2003");
+    public static final Version VERSION_2014 = new Version("2014");
 
     /**
-     * Miscellaneous version constants.
+     * Miscellaneous version constants used for GML versions.
      */
     public static final Version VERSION_3_0 = new Version("3.0"),
                                 VERSION_3_2 = new Version("3.2");

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListUID.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -66,6 +66,8 @@ public final class CodeListUID {
      * @param  context     the current (un)marshalling context, or {@code null} if none.
      * @param  identifier  the UML identifier of the code list.
      * @return the URL to the given code list in the given schema.
+     *
+     * @see org.apache.sis.xml.XML#SCHEMAS
      */
     private static String schema(final Context context, final String identifier) {
         final String prefix, root, path;
@@ -74,7 +76,7 @@ public final class CodeListUID {
             root = Schemas.METADATA_ROOT_LEGACY;
             path = Schemas.CODELISTS_PATH_LEGACY;   // Future SIS version may switch between localized/unlocalized file.
         } else {
-            prefix = "mdb";
+            prefix = "cat";
             root = Schemas.METADATA_ROOT;
             path = Schemas.CODELISTS_PATH;
         }

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilterVersion.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -85,6 +85,8 @@ enum FilterVersion {
 
     /**
      * GML using the legacy {@code "http://www.opengis.net/gml"} namespace.
+     * Note that the use of GML 3.2 may imply that use of ISO 19139:2007,
+     * which requires the use of {@link #ALL}.
      */
     GML31(Namespaces.GML, LegacyNamespaces.GML),
 
@@ -163,6 +165,6 @@ enum FilterVersion {
         toImpl = new HashMap<>(first.toImpl);
         toView.putAll(more.toView);
         toImpl.putAll(more.toImpl);
-        manyToOne = true;
+        manyToOne = first.manyToOne | more.manyToOne;
     }
 }

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/MarshalContext.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -85,6 +85,7 @@ public abstract class MarshalContext {
      *   <caption>Supported schemas</caption>
      *   <tr><th>Prefix</th>  <th>Standard</th>                   <th>Typical values</th></tr>
      *   <tr><td>gml</td>     <td>Geographic Markup Language</td> <td>{@code 3.0}, {@code 3.2}</td></tr>
+     *   <tr><td>gmd</td>     <td>Geographic MetaData</td>        <td>{@code 2007}, {@code 2016}</td></tr>
      * </table>
      *
      * @param  prefix  one of the above-cited prefix.

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -59,7 +59,7 @@ abstract class Pooled {
      * The keys of entries that can be stored in the {@link #schemas} map.
      * Those keys are documented in {@link XML#SCHEMAS}.
      */
-    private static final String[] SCHEMA_KEYS = {"gmd"};
+    private static final String[] SCHEMA_KEYS = {"cat", "gmd"};
 
     /**
      * {@code true} if the JAXB implementation is the one bundled in JDK 6, or {@code false}
@@ -241,30 +241,36 @@ abstract class Pooled {
     protected abstract void reset(final Object key, final Object value) throws JAXBException;
 
     /**
-     * Returns the {@code FilterVersion} enumeration value to use for the current GML version, or
-     * {@code null} if the SIS native version is suitable. If this method returns a non-null value,
-     * then the output generated by JAXB will need to go through a {@link FilteredStreamWriter}
-     * in order to replace the namespace of the GML version implemented by SIS by the namespace of
-     * the GML version asked by the user.
+     * Returns the {@code FilterVersion} enumeration value to use for the current GML or metadata version,
+     * or {@code null} if the SIS native versions are suitable. If this method returns a non-null value,
+     * then the output generated by JAXB will need to go through a {@link FilteredStreamWriter} in order
+     * to replace the namespace of versions implemented by SIS by the namespace of versions requested by
+     * the user.
      *
      * @see FilteredNamespaces
      */
     final FilterVersion getFilterVersion() {
-        if (versionGML != null) {
-            // Apply namespace replacements only for older versions than the one supported natively by SIS.
-            if (versionGML.compareTo(LegacyNamespaces.VERSION_3_2_1) < 0) {
-                return FilterVersion.GML31;
-            }
-        } else if (versionMetadata != null) {
-            // Only if GML version is unspecified, because GML version implies metadata version.
-            if (versionMetadata.compareTo(LegacyNamespaces.ISO_19115_3) < 0) {
-                return FilterVersion.ISO19139;
-            }
-        } else if ((bitMasks & Context.MARSHALLING) == 0) {
-            // Force namespace replacements at unmarshalling time (illegal for marshalling).
-            return FilterVersion.ALL;
+        /*
+         * If no version is specified, the the default behavior will be:
+         *   - enable namespace replacement on unmarshalling (in order to accept all versions)
+         *   - disable namespace replacement on marshalling (in order to use latest version).
+         */
+        final boolean byDefault = (bitMasks & Context.MARSHALLING) == 0;
+        /*
+         * Bitwise combination of legacy schemas to support:
+         *   1: namespace replacement needed for GML
+         *   2: namespace replacement needed for metadata.
+         */
+        int combine = 0;
+        if (versionGML      == null ? byDefault : versionGML     .compareTo(LegacyNamespaces.VERSION_3_2_1) < 0) combine  = 1;
+        if (versionMetadata == null ? byDefault : versionMetadata.compareTo(LegacyNamespaces.VERSION_2014)  < 0) combine |= 2;
+        switch (combine) {
+            case 0:  return null;
+            case 1:  return FilterVersion.GML31;
+            case 2:  return FilterVersion.ISO19139;
+            case 3:  return FilterVersion.ALL;
+            default: throw new AssertionError(combine);     // Should never happen.
         }
-        return null;
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -60,9 +60,9 @@ import static org.apache.sis.util.Argume
  *
  * <table class="sis">
  *   <caption>Versions of standards applied at marshalling time</caption>
- *   <tr><th>Topic</th>       <th>SIS 0.3 to 0.8</th>  <th>SIS 1.0</th></tr>
- *   <tr><td>Metadata</td>    <td>ISO 19139:2007</td>  <td>ISO 19115-3</td></tr>
- *   <tr><td>Referencing</td> <td>ISO 19136</td>       <td>ISO 19136</td></tr>
+ *   <tr><th>Topic</th>       <th>SIS 0.3 to 0.8</th>  <th>SIS 1.0</th>          <td>Remarks</td></tr>
+ *   <tr><td>Metadata</td>    <td>ISO 19139:2007</td>  <td>ISO 19115-3:2016</td> <td></td></tr>
+ *   <tr><td>Referencing</td> <td>ISO 19136:2007</td>  <td>ISO 19136:2007</td>   <td>Same as GML 3.2</td></tr>
  * </table>
  *
  * This class defines also some property keys that can be given to the {@link Marshaller}
@@ -148,19 +148,26 @@ public final class XML extends Static {
      *       (for example {@code <gco:Distance>}).</li>
      * </ul>
      *
-     * Only one {@code Map} key is currently recognized: {@code "gmd"}, which stands
-     * for the legacy ISO 19139:2007 schemas. Additional keys, if any, are ignored.
-     * Future SIS versions may recognize more keys.
+     * Two {@code Map} keys are currently recognized: {@code "cat"} and {@code "gmd"},
+     * which stands for the new ISO 19115-3:2016 and the legacy ISO 19139:2007 schemas respectively.
+     * The key to be used depends on the {@linkplain #METADATA_VERSION metadata version} to be marshalled.
+     * Additional keys, if any, are ignored. Future SIS versions may recognize more keys.
      *
      * <div class="section">Valid values</div>
+     * The following table gives some typical URLs.
+     * The URL in bold character is the default one.
+     *
      * <table class="sis">
      *   <caption>Supported schemas</caption>
      *   <tr><th>Map key</th> <th>Typical values (choose only one)</th></tr>
+     *   <tr><td><b>cat</b></td><td>
+     *     <b>http://standards.iso.org/iso/19115/</b>
+     *   </td></tr>
      *   <tr><td><b>gmd</b></td><td>
-     *     http://www.isotc211.org/2005/<br>
-     *     http://schemas.opengis.net/iso/19139/20070417/<br>
-     *     http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/<br>
-     *     http://eden.ign.fr/xsd/fra/20060922/
+     *        http://www.isotc211.org/2005/<br>
+     *     <b>http://schemas.opengis.net/iso/19139/20070417/</b><br>
+     *        http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/<br>
+     *        http://eden.ign.fr/xsd/fra/20060922/
      *   </td></tr>
      * </table>
      */
@@ -174,19 +181,23 @@ public final class XML extends Static {
      * <div class="section">Current limitation</div>
      * In current SIS implementation, this property is honored only by the {@link MarshallerPool} constructors.
      * Specifying this property to {@link javax.xml.bind.Marshaller#setProperty(String, Object)} is too late.
+     *
+     * @deprecated Use {@link javax.xml.bind.annotation.XmlSchema} instead.
      */
+    @Deprecated
     public static final String DEFAULT_NAMESPACE = "org.apache.sis.xml.defaultNamespace";
 
     /**
      * Specifies the GML version of the document to be marshalled or unmarshalled.
      * The GML version may affect the set of XML elements to be marshalled and their namespaces.
+     * Note that GML 3.2 is identical to ISO 19136:2007.
      *
      * <div class="note"><b>Compatibility note:</b>
      * Newer versions typically have more elements, but not always. For example in {@code <gml:VerticalDatum>},
      * the {@code <gml:verticalDatumType>} property presents in GML 3.0 and 3.1 has been removed in GML 3.2.</div>
      *
      * The value can be {@link String} or {@link Version} object.
-     * If no version is specified, then the most recent GML version is assumed.
+     * If no version is specified, then the most recent supported GML version is assumed.
      *
      * <div class="section">Supported GML versions</div>
      * Apache SIS currently supports GML 3.2.1 by default. SIS can read and write GML 3.2
@@ -201,16 +212,21 @@ public final class XML extends Static {
      * Specifies the metadata version of the document to be marshalled or unmarshalled.
      * The metadata version may affect the set of XML elements to be marshalled and their namespaces.
      * The value can be {@link String} or {@link Version} object.
-     * If no version is specified, then the most recent metadata version is assumed (ISO 19115-3).
+     * If no version is specified, then the most recent supported metadata version is assumed.
+     *
+     * <p>The metadata version may be ignored when the metadata to marshal is inside a GML element.
+     * For example the {@code <gml:domainOfValidity>} element inside a coordinate reference system
+     * is always marshalled using ISO 19139:2007 if the enclosing element uses GML 3.2 schema.</p>
      *
      * <div class="section">Supported metadata versions</div>
-     * Apache SIS currently supports ISO 19115-3 by default (with the value "2014").
-     * SIS can write legacy ISO 19139:2007 documents if this property is set to "2003".
+     * Apache SIS currently supports ISO 19115-3:2016 by default. This version can be explicitly
+     * set with value "2014" or above (because the abstract model was defined in ISO 19115-1:2014).
+     * SIS can write legacy ISO 19139:2007 documents if this property is set to a value less than "2014".
      * Both versions can be read without the need to specify this property.
      *
      * @since 1.0
      */
-    public static final String METADATA_VERSION = "org.apache.sis.metadata.version";
+    public static final String METADATA_VERSION = "org.apache.sis.xml.version.metadata";
 
     /**
      * Allows client code to replace {@code xlink} or {@code uuidref} attributes by the actual objects to use.

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gmd/LanguageCodeTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -134,7 +134,7 @@ public final strictfp class LanguageCode
         final MetadataMock metadata = new MetadataMock(Locale.JAPANESE);
         final Marshaller marshaller = pool.acquireMarshaller();
         assertNull(marshaller.getProperty(XML.STRING_SUBSTITUTES));
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         assertXmlEquals(getMetadataXML(LANGUAGE_CODE), marshal(marshaller, metadata), "xmlns:*");
         pool.recycle(marshaller);
     }
@@ -198,7 +198,7 @@ public final strictfp class LanguageCode
     public void testMarshalCharacterString() throws JAXBException {
         final MetadataMock metadata = new MetadataMock(Locale.JAPANESE);
         final Marshaller marshaller = pool.acquireMarshaller();
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         marshaller.setProperty(XML.STRING_SUBSTITUTES, new String[] {"dummy","language","foo"});
         assertArrayEquals(new String[] {"language"}, (String[]) marshaller.getProperty(XML.STRING_SUBSTITUTES));
         assertXmlEquals(getMetadataXML(CHARACTER_STRING), marshal(marshaller, metadata), "xmlns:*");

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -66,6 +66,12 @@ import static org.apache.sis.test.Assert
  */
 public abstract strictfp class XMLTestCase extends TestCase {
     /**
+     * Miscellaneous version constants used for ISO standards.
+     */
+    protected static final Version VERSION_2007 = new Version("2007"),
+                                   VERSION_2014 = LegacyNamespaces.VERSION_2014;
+
+    /**
      * The timezone used for the tests. We intentionally use a timezone different than UTC in order
      * to have an error of one or two hours if a code fails to take timezone offset in account.
      */

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java?rev=1822011&r1=1822010&r2=1822011&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/util/iso/NameMarshallingTest.java [UTF-8] Tue Jan 23 14:56:31 2018
@@ -67,7 +67,7 @@ public final strictfp class NameMarshall
             pool = new MarshallerPool(JAXBContext.newInstance(IdentifiedObjectMock.class), null);
         }
         final Marshaller marshaller = pool.acquireMarshaller();
-        marshaller.setProperty(XML.METADATA_VERSION, LegacyNamespaces.ISO_19139);
+        marshaller.setProperty(XML.METADATA_VERSION, VERSION_2007);
         final String xml = marshal(marshaller, new IdentifiedObjectMock(null, name));
         pool.recycle(marshaller);
         return xml;



Mime
View raw message