sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: Abandon the attemps to fix https://issues.apache.org/jira/browse/SIS-481. Tried hard, I have been unable to take dynamic control on the namespace. This causes also abandon of https://issues.apache.org/jira/browse/SIS-482
Date Fri, 15 Nov 2019 02:47:52 GMT
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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 8289eef  Abandon the attemps to fix https://issues.apache.org/jira/browse/SIS-481.
Tried hard, I have been unable to take dynamic control on the namespace. This causes also
abandon of https://issues.apache.org/jira/browse/SIS-482
8289eef is described below

commit 8289eefcf0df628fac8bf63bb0f9112dc2572f4f
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Nov 15 03:45:49 2019 +0100

    Abandon the attemps to fix https://issues.apache.org/jira/browse/SIS-481.
    Tried hard, I have been unable to take dynamic control on the namespace.
    This causes also abandon of https://issues.apache.org/jira/browse/SIS-482
---
 .../java/org/apache/sis/xml/TransformVersion.java  |  1 +
 .../src/main/java/org/apache/sis/xml/XML.java      | 51 ++++++++++++----------
 .../java/org/apache/sis/xml/NamespacesTest.java    |  3 +-
 3 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
index 3b988c2..711220c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/TransformVersion.java
@@ -25,6 +25,7 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
 
 /**
  * The target version of standards for {@link Transformer}.
+ * This is used only for versions different than the native versions declared in JAXB annotations.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Cullen Rombach (Image Matters)
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
index feff66b..81c7bc6 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
@@ -137,11 +137,11 @@ public final class XML extends Static {
     public static final String TIMEZONE = "org.apache.sis.xml.timezone";
 
     /**
-     * Specifies the root URL of schemas. This property specifies only the schema locations;
-     * it does not change the content of marshalled XML documents (for content schemas, see
-     * {@link #METADATA_VERSION}). The value for this property shall be an instance of
-     * {@link Map Map&lt;String,String&gt;}.
-     * This property controls the URL to be used when marshalling the following elements:
+     * Specifies the root URLs of some schemas.
+     * This property modifies only the URL strings; it does not change the structure of
+     * marshalled XML documents (for content structure, see {@link #METADATA_VERSION}).
+     * The value for this property shall be an instance of {@link Map Map&lt;String,String&gt;}.
+     * This property controls the URLs to be used when marshalling the following elements:
      *
      * <ul>
      *   <li>The value of the {@code codeList} attribute when marshalling subclasses
of
@@ -150,6 +150,15 @@ public final class XML extends Static {
      *       (for example {@code <gco:Distance>}).</li>
      * </ul>
      *
+     * <div class="note"><b>Examples:</b>
+     * URLs in code lists and is units of measurement may appear as below.
+     * The underlined fragment is the part that can be replaced by {@code SCHEMAS} values:
+     * <ul>
+     *   <li><code><u>http://standards.iso.org/iso/19115/</u>resources/Codelist/cat/codelists.xml#LanguageCode</code></li>
+     *   <li><code><u>http://www.isotc211.org/2005/</u>resources/Codelist/gmxCodelists.xml#LanguageCode</code></li>
+     *   <li><code><u>http://www.isotc211.org/2005/</u>resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])</code></li>
+     * </ul></div>
+     *
      * The currently recognized keys are listed below.
      * The entries to be used depend on the {@linkplain #METADATA_VERSION metadata version}
to be marshalled.
      * For example the {@code "cat"} entry is used when marshalling ISO 19115-3:2016 document,
while the
@@ -157,24 +166,20 @@ public final class XML extends Static {
      * The following table gives some typical URLs, with the default URL in bold characters:
      *
      * <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 class="hsep"><b>gmd</b></td><td class="hsep">
-     *     <b>http://www.isotc211.org/2005/</b><br>
-     *        http://schemas.opengis.net/iso/19139/20070417/<br>
-     *        http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/
-     *   </td></tr>
-     *   <tr><td class="hsep"><b>gmi</b></td><td class="hsep">
-     *        http://www.isotc211.org/2005/<br>
-     *     <b>http://standards.iso.org/iso/19115/-2/gmi/1.0/</b>
-     *   </td></tr>
-     *   <tr><td class="hsep"><b>gml</b></td><td class="hsep">
-     *     <b>http://schemas.opengis.net/gml/3.2.1/</b><br>
-     *        https://www.isotc211.org/2005/gml/
-     *   </td></tr>
+     *   <caption>Supported root URLs</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 class="hsep"><b>gmd</b></td>
+     *     <td class="hsep">
+     *         <b>http://www.isotc211.org/2005/</b><br>
+     *            http://schemas.opengis.net/iso/19139/20070417/<br>
+     *            http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/</td>
+     *   </tr>
      * </table>
      *
      * Additional keys, if any, are ignored. Future SIS versions may recognize more keys.
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 5c7dfd4..3d55c91 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
@@ -26,7 +26,7 @@ import static org.junit.Assert.*;
  * Tests the {@link Namespaces} class.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.1
  * @since   0.8
  * @module
  */
@@ -41,6 +41,7 @@ public final strictfp class NamespacesTest extends TestCase {
         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("srv1", Namespaces.getPreferredPrefix("http://www.isotc211.org/2005/srv",
null));
+        assertEquals("gmd",  Namespaces.getPreferredPrefix("http://www.isotc211.org/2005/gmd",
null));
     }
 
     /**


Mime
View raw message