sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1817808 - in /sis/branches/ISO-19115-3/core/sis-utility/src/main: java/org/apache/sis/internal/util/ java/org/apache/sis/xml/ resources/org/apache/sis/xml/
Date Mon, 11 Dec 2017 18:43:40 GMT
Author: desruisseaux
Date: Mon Dec 11 18:43:40 2017
New Revision: 1817808

URL: http://svn.apache.org/viewvc?rev=1817808&view=rev
Log:
Initial port of the mapping from ISO 19139 namespaces to ISO 19115-3 namespaces.
This is part of commit e780d66b4d7d59368e742ba01777a151d8827ea8 from Image Matter.

This revision can built but is known to have test failure.
Tests will pass only after we completed the port of all ISO 19115-3 work.

Added:
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java   (with props)
    sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/
    sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt   (with props)
Modified:
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.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/FilteredNamespaces.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamReader.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamWriter.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1817808&r1=1817807&r2=1817808&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -51,7 +51,7 @@ import java.util.function.Predicate;
  * bit tedious to explain, which is an other indication that they should not be in public API.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -366,6 +366,8 @@ public final class CollectionsExt extend
      * @param  <E>  the type of elements in the set.
      * @param  set  the set to make unmodifiable, or {@code null}.
      * @return a unmodifiable version of the given set, or {@code null} if the given set was null.
+     *
+     * @see #compact(Set)
      */
     public static <E> Set<E> unmodifiableOrCopy(Set<E> set) {
         if (set != null) {
@@ -402,6 +404,8 @@ public final class CollectionsExt extend
      * @param  <V>  the type of values in the map.
      * @param  map  the map to make unmodifiable, or {@code null}.
      * @return a unmodifiable version of the given map, or {@code null} if the given map was null.
+     *
+     * @see #compact(Map)
      */
     public static <K,V> Map<K,V> unmodifiableOrCopy(Map<K,V> map) {
         if (map != null) {
@@ -595,19 +599,43 @@ public final class CollectionsExt extend
      * @param  <V>  the type of values in the map.
      * @param  map  the map to compact, or {@code null}.
      * @return a potentially compacted map, or {@code null} if the given map was null.
+     *
+     * @see #unmodifiableOrCopy(Map)
      */
     public static <K,V> Map<K,V> compact(final Map<K,V> map) {
         if (map != null) {
             switch (map.size()) {
-                case 0:  return Collections.emptyMap();
-                case 1:  final Map.Entry<K,V> entry = map.entrySet().iterator().next();
-                         return Collections.singletonMap(entry.getKey(), entry.getValue());
+                case 0: return Collections.emptyMap();
+                case 1: final Map.Entry<K,V> entry = map.entrySet().iterator().next();
+                        return Collections.singletonMap(entry.getKey(), entry.getValue());
             }
         }
         return map;
     }
 
     /**
+     * Returns a more compact representation of the given set. This method is similar to
+     * {@link #unmodifiableOrCopy(Set)} except that it does not wrap the set in an unmodifiable
+     * view. The intend is to avoid one level of indirection for performance and memory reasons.
+     * This is okay only if the set is kept in a private field and never escape outside that class.
+     *
+     * @param  <E>  the type of elements in the set.
+     * @param  set  the set to compact, or {@code null}.
+     * @return a unmodifiable version of the given set, or {@code null} if the given set was null.
+     *
+     * @see #unmodifiableOrCopy(Set)
+     */
+    public static <E> Set<E> compact(final Set<E> set) {
+        if (set != null) {
+            switch (set.size()) {
+                case 0: return Collections.emptySet();
+                case 1: return Collections.singleton(set.iterator().next());
+            }
+        }
+        return set;
+    }
+
+    /**
      * Returns a snapshot of the given list. The returned list will not be affected by changes
      * in the given list after this method call. This method makes no guaranteed about whether
      * the returned list is modifiable or not.

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=1817808&r1=1817807&r2=1817808&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] Mon Dec 11 18:43:40 2017
@@ -103,6 +103,13 @@ enum FilterVersion {
     final Map<String,String> toImpl;
 
     /**
+     * {@code true} if application of {@link #toView} result in many namespaces collapsed into
+     * a single namespace. In those case, {@link #toImpl} is not sufficient for performing the
+     * reverse operation; we need {@link FilteredStreamResolver}.
+     */
+    final boolean manyToOne;
+
+    /**
      * Creates a new enum for replacing only one namespace.
      *
      * @param  impl  the namespace used in JAXB annotations (should be latest schema).
@@ -111,6 +118,7 @@ enum FilterVersion {
     private FilterVersion(final String impl, final String view) {
         this.toView = singletonMap(impl, view);
         this.toImpl = singletonMap(view, impl);
+        manyToOne = false;
     }
 
     /**
@@ -135,6 +143,7 @@ enum FilterVersion {
             toView.put(p, v);
             toImpl.put(v, p);
         }
+        manyToOne = true;
     }
 
     /**
@@ -145,5 +154,6 @@ enum FilterVersion {
         toImpl = new HashMap<>(first.toImpl);
         toView.putAll(more.toView);
         toImpl.putAll(more.toImpl);
+        manyToOne = true;
     }
 }

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredNamespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredNamespaces.java?rev=1817808&r1=1817807&r2=1817808&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredNamespaces.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredNamespaces.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -24,6 +24,8 @@ import javax.xml.namespace.NamespaceCont
 /**
  * Substitutes at (un)marshalling time the XML namespaces used by SIS by the namespaces used in the XML document.
  * This class is used internally by {@link FilteredStreamReader} and {@link FilteredStreamWriter} only.
+ * Current {@code FilteredNamespaces} implementation takes care of XML prefixes only;
+ * the stream reader and writer do the rest of the work.
  *
  * <div class="section">The problem</div>
  * When the XML schemas of an international standard is updated, the URL of the namespace is often modified.
@@ -109,27 +111,12 @@ final class FilteredNamespaces implement
     }
 
     /**
-     * Returns the URI to make visible to the user of this filter.
-     */
-    private String toView(final String uri) {
-        final String replacement = toView.get(uri);
-        return (replacement != null) ? replacement : uri;
-    }
-
-    /**
-     * Returns the URI used by the {@linkplain #context}.
-     */
-    private String toImpl(final String uri) {
-        final String replacement = toImpl.get(uri);
-        return (replacement != null) ? replacement : uri;
-    }
-
-    /**
      * Returns the namespace for the given prefix.
      */
     @Override
     public String getNamespaceURI(final String prefix) {
-        return toView(context.getNamespaceURI(prefix));
+        final String uri = context.getNamespaceURI(prefix);
+        return toView.getOrDefault(uri, uri);
     }
 
     /**
@@ -137,7 +124,7 @@ final class FilteredNamespaces implement
      */
     @Override
     public String getPrefix(final String namespaceURI) {
-        return context.getPrefix(toImpl(namespaceURI));
+        return context.getPrefix(toImpl.getOrDefault(namespaceURI, namespaceURI));
     }
 
     /**
@@ -146,6 +133,6 @@ final class FilteredNamespaces implement
     @Override
     @SuppressWarnings("unchecked")
     public Iterator<String> getPrefixes(final String namespaceURI) {
-        return context.getPrefixes(toImpl(namespaceURI));
+        return context.getPrefixes(toImpl.getOrDefault(namespaceURI, namespaceURI));
     }
 }

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamReader.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamReader.java?rev=1817808&r1=1817807&r2=1817808&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamReader.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamReader.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -31,13 +31,14 @@ import javax.xml.stream.util.StreamReade
  * See {@link FilteredNamespaces} for more information.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.4
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.4
  * @module
  */
-final class FilteredStreamReader extends StreamReaderDelegate {
+class FilteredStreamReader extends StreamReaderDelegate {
     /**
-     * The other version to unmarshall from.
+     * The other version to unmarshal from.
      */
     private final FilterVersion version;
 
@@ -53,25 +54,26 @@ final class FilteredStreamReader extends
      * Converts a JAXB URI to the URI seen by the consumer of this wrapper.
      */
     private String toView(final String uri) {
-        final String replacement = version.toView.get(uri);
-        return (replacement != null) ? replacement : uri;
+        return version.toView.getOrDefault(uri, uri);
     }
 
     /**
      * Converts a URI read from the XML document to the URI to give to JAXB.
      */
-    private String toImpl(final String uri) {
-        final String replacement = version.toImpl.get(uri);
-        return (replacement != null) ? replacement : uri;
+    final String toImpl(final String uri) {
+        return version.toImpl.getOrDefault(uri, uri);
     }
 
     /**
      * Converts a name read from the XML document to the name to give to JAXB.
+     * The default implementation assumes a simple bijective mapping between the namespace URIs.
+     * The {@link FilteredStreamResolver} subclass implements a more complex mapping where the
+     * namespace depends on the element (class or attribute) name.
      */
-    private QName toImpl(QName name) {
+    QName toImpl(QName name) {
         final String namespaceURI = name.getNamespaceURI();
         final String replacement = toImpl(namespaceURI);
-        if (replacement != namespaceURI) { // Really identity check.
+        if (replacement != namespaceURI) {                          // Identity checks are okay here.
             name = new QName(namespaceURI, name.getLocalPart(), name.getPrefix());
         }
         return name;
@@ -83,7 +85,7 @@ final class FilteredStreamReader extends
         super.require(type, toView(namespaceURI), localName);
     }
 
-    /** Returns the context of the underlying reader wrapped in a filter that convert the namespaces on the fly. */
+    /** Returns the context of the underlying reader wrapped in a filter that converts the namespaces on the fly. */
     @Override
     public NamespaceContext getNamespaceContext() {
         return new FilteredNamespaces(super.getNamespaceContext(), version, true);
@@ -107,7 +109,12 @@ final class FilteredStreamReader extends
         return toImpl(super.getNamespaceURI());
     }
 
-    /** Forwards the call, then replaces the returned URI if needed. */
+    /**
+     * Forwards the call, then replaces the returned URI if needed.
+     *
+     * <b>Note:</b> the index passed to this method is the index of a namespace declaration on the root element.
+     * This should not matter as long as each <em>element</em> has the proper namespace URI.
+     */
     @Override
     public String getNamespaceURI(int index) {
         return toImpl(super.getNamespaceURI(index));

Added: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java?rev=1817808&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java (added)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -0,0 +1,352 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.xml;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.List;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.io.IOException;
+import java.io.LineNumberReader;
+import java.io.InputStreamReader;
+import java.util.InvalidPropertiesFormatException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.util.CollectionsExt;
+
+
+/**
+ * A {@code StreamReader} which uses a more complex algorithm backed by a dictionary for identifying the XML namespaces
+ * expected by JAXB implementation. This is used when a single namespace in a legacy schema has been splitted into many
+ * namespaces in a newer schema. This happen for example in the upgrade from ISO 19139 to ISO 19115-3. In such cases,
+ * we need to check which attribute is being mapped in order to determine the new namespace.
+ *
+ * @author  Cullen Rombach (Image Matters)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 1.0
+ * @since   1.0
+ * @module
+ */
+final class FilteredStreamResolver extends FilteredStreamReader {
+    /**
+     * Location of the file listing types and attributes contained in namespaces.
+     * The file location is relative to this {@code NamespaceContent} class.
+     * The file format is a tree structured with indentation as below:
+     *
+     * <ul>
+     *   <li>Lines with zero-spaces indentation are namespace URIs.</li>
+     *   <li>Lines with two-spaces  indentation are classes within the last namespace URIs found so far.</li>
+     *   <li>Lines with four-spaces indentation are attributes within the last class found so far.</li>
+     *   <li>All other indentations are illegal and cause an {@link InvalidPropertiesFormatException} to be thrown.
+     *       This exception type is not really appropriate since the file format is not a {@code .properties} file,
+     *       but it is the closest we could find in existing exceptions and we don't want to define a new exception
+     *       type since this error should never happen.</li>
+     * </ul>
+     */
+    private static final String FILENAME = "NamespaceContent.txt";
+
+    /**
+     * A key in {@link #NAMESPACES} sub-map meaning that the value (a namespace URI) is for the type instead
+     * than for an attribute. Shall be the same string than the one used in {@value #FILENAME} resource file.
+     */
+    private static final String TYPE_KEY = "<type>";
+
+    /**
+     * The mapping from (<var>type</var>, <var>attribute</var>) pairs to namespaces.
+     *
+     * <ul>
+     *   <li>Keys are XML names of types (e.g. {@code "CI_Citation"})</li>
+     *   <li>Values are maps where:<ul>
+     *     <li>Keys are XML names of attributes (e.g. {@code "title"}) or {@value #TYPE_KEY}</li>
+     *     <li>Values are namespace URI</li>
+     *   </ul></li>
+     * </ul>
+     *
+     * This map is initialized only once and should not be modified after that point.
+     * The file format is described in {@link #FILENAME}.
+     */
+    private static final Map<String, Map<String,String>> NAMESPACES;
+    static {
+        final Map<String, Map<String,String>> m = new HashMap<>(250);
+        try (final LineNumberReader in = new LineNumberReader(new InputStreamReader(
+                FilteredStreamResolver.class.getResourceAsStream(FILENAME), "UTF-8")))
+        {
+            Map<String,String> attributes = null;   // All attributes for a given type.
+            String namespace = null;                // Value to store in 'attributes' map.
+            String line;
+            while ((line = in.readLine()) != null) {
+                final int length = line.length();
+                final int start = CharSequences.skipLeadingWhitespaces(line, 0, length);
+                if (start < length && line.charAt(start) != '#') {
+                    final String element = line.substring(start).trim().intern();
+                    switch (start) {
+                        case 0: {                       // New namespace URI.
+                            namespace  = element;
+                            attributes = null;
+                            continue;
+                        }
+                        case 2: {                       // New type in above namespace URI.
+                            attributes = m.computeIfAbsent(element, (k) -> new HashMap<>());
+                            continue;
+                        }
+                        case 4: {                       // New attribute in above type.
+                            if (attributes != null && namespace != null) {
+                                attributes.put(element, namespace);
+                                continue;
+                            }
+                            // Fall through for reporting illegal format.
+                        }
+                    }
+                    throw new InvalidPropertiesFormatException(Errors.format(      // See FILE javadoc.
+                            Errors.Keys.ErrorInFileAtLine_2, FILENAME, in.getLineNumber()));
+                }
+            }
+        } catch (IOException e) {
+            throw new ExceptionInInitializerError(e);
+        }
+        /*
+         * At this point we finished computing the map values. Many values are maps with only 1 entry.
+         * Save a little bit of space by replacing maps of 1 element by Collections.singletonMap(…).
+         */
+        m.replaceAll((k, v) -> CollectionsExt.compact(v));
+        NAMESPACES = m;
+    }
+
+    /**
+     * The mapping from attribute names to types where such attribute is declared.
+     * An attribute of the same name may be declared in many types.
+     *
+     * @see #declaringTypes(String)
+     */
+    private static final Map<String, Set<String>> DECLARING_TYPES;
+    static {
+        final Map<String, Set<String>> m = new HashMap<>(500);
+        for (final Map.Entry<String, Map<String,String>> e : NAMESPACES.entrySet()) {
+            final String type = e.getKey();
+            for (final String attribute : e.getValue().keySet()) {
+                m.computeIfAbsent(attribute, (k) -> new HashSet<>()).add(type);
+            }
+        }
+        /*
+         * At this point we finished computing the map values. Many values are the same sets.
+         * For example the {CI_Citation} singleton set occurs often. Following code replaces
+         * duplicated sets by shared instances in order to save a little bit of space.
+         */
+        final Map<Set<String>, Set<String>> unique = new HashMap<>(200);
+        m.replaceAll((k, v) -> {
+            v = CollectionsExt.compact(v);
+            final Set<String> r = unique.putIfAbsent(v, v);
+            return (r != null) ? r : v;
+        });
+        DECLARING_TYPES = m;
+    }
+
+    /**
+     * Elements that need to have their name changed.
+     * For example {@code gmd:URL} needs to be changed to {@code gco:CharacterString} for reading ISO 19139.
+     *
+     * <ul>
+     *   <li>key:   old element name</li>
+     *   <li>value: new element name</li>
+     * </ul>
+     *
+     * @see #newName(String)
+     */
+    private static final Map<String,String> NAME_CHANGES = Collections.singletonMap("URL", "CharacterString");
+
+    /**
+     * List of encountered XML tags, in order. Used for backtracking.
+     * Elements are removed from this list when they are closed.
+     */
+    private final List<String> outerElements;
+
+    /**
+     * Creates a new filter for the given version of the standards.
+     */
+    FilteredStreamResolver(final XMLStreamReader in, final FilterVersion version) {
+        super(in, version);
+        outerElements = new ArrayList<>();
+    }
+
+    /**
+     * Forwards the call and keep trace of the XML element opened up to this point.
+     */
+    @Override
+    public int next() throws XMLStreamException {
+        return traceElements(super.next());
+    }
+
+    /**
+     * Forwards the call and keep trace of the XML element opened up to this point.
+     */
+    @Override
+    public int nextTag() throws XMLStreamException {
+        return traceElements(super.nextTag());
+    }
+
+    /**
+     * Keeps trace of XML elements opened up to this point.
+     *
+     * @param  type  value of {@link #getEventType()}.
+     * @return {@code type}, returned for convenience.
+     */
+    private int traceElements(final int type) {
+        switch (type) {
+            case START_ELEMENT: {
+                outerElements.add(getLocalName());
+                break;
+            }
+            case END_ELEMENT: {
+                /*
+                 * If this is an end element, close the last open one with a matching name.
+                 * It should be the last list element in a well-formed XML, but we loop in
+                 * the list anyway as a safety.
+                 */
+                final String name = getLocalName();
+                for (int i = outerElements.size(); --i >= 0;) {
+                    if (name.equals(outerElements.get(i))) {
+                        outerElements.remove(i);
+                        break;
+                    }
+                }
+                break;
+            }
+        }
+        return type;
+    }
+
+    /**
+     * Return the namespace used by implementation (the SIS classes with JAXB annotations)
+     * in the context of the current part of the XML document being read.
+     *
+     * @param   name       the element or attribute name currently being read.
+     * @param   namespace  the namespace declared in the document being read (e.g. an ISO 19139 namespace).
+     * @return  the namespace URI for the element or attribute in the current context (e.g. an ISO 19115-3 namespace).
+     */
+    private String toImplNamespace(final String name, final String namespace) {
+        final Set<String> declaringTypes = DECLARING_TYPES.get(name);
+        if (declaringTypes == null) {
+            /*
+             * If the element is a root element, return the associated namespace.
+             */
+            final Map<String,String> attributes = NAMESPACES.get(name);
+            if (attributes != null) {
+                return attributes.getOrDefault(TYPE_KEY, namespace);
+            }
+        } else {
+            /*
+             * If the element is not a root element, we need to backtrack until we find the latest
+             * possible parent element. Then, we use the namespace associated with that parent.
+             */
+            for (int i = outerElements.size(); --i >= 0;) {
+                final String parent = outerElements.get(i);
+                if (declaringTypes.contains(parent)) {
+                    /*
+                     * A NullPointerException below would be a bug in our algorithm because
+                     * we constructed DECLARING_TYPES from NAMESPACES keys only.
+                     */
+                    return NAMESPACES.get(parent).getOrDefault(name, namespace);
+                }
+            }
+        }
+        return toImpl(namespace);
+    }
+
+    /**
+     * If the given text seems to be a qualified name and its prefix is recognized, replaces its namespace URI.
+     * Otherwise returns the text unchanged. This method is invoked for transforming attribute values.
+     */
+    private String toImplName(String text) {
+        int length = CharSequences.skipTrailingWhitespaces(text, 0, text.length());
+        int start  = CharSequences.skipLeadingWhitespaces (text, 0, length);
+        for (int sep=start; sep < length; sep++) {
+            if (text.charAt(sep) == ':') {
+                if (sep != start) {
+                    // Prefix exists, check everything
+                    String prefix = text.substring(start, sep);
+                    String uri = getParent().getNamespaceContext().getNamespaceURI(prefix);
+                    if (uri != null && !uri.isEmpty()) {
+                        String name = text.substring(sep+1, length);
+                        uri = toImplNamespace(name, uri);
+                        prefix = Namespaces.getPreferredPrefix(uri, prefix);
+                        text = prefix + ':' + name;
+                    }
+                }
+                break;
+            }
+        }
+        return text;
+    }
+
+    /**
+     * Converts a name read from the XML document to the name to give to JAXB.
+     * The new namespace depends on both the old namespace and the element name.
+     */
+    @Override
+    final QName toImpl(QName name) {
+        final String namespaceURI = name.getNamespaceURI();
+        final String oldLocal = name.getLocalPart();
+        final String newLocal = NAME_CHANGES.getOrDefault(oldLocal, oldLocal);
+        final String replacement = toImplNamespace(newLocal, namespaceURI);
+        if (replacement != namespaceURI || newLocal != oldLocal) {               // Identity checks are okay here.
+            name = new QName(replacement, oldLocal, name.getPrefix());
+        }
+        return name;
+    }
+
+    /**
+     * Forwards the call, then replaces the local name if needed.
+     */
+    @Override
+    public String getLocalName() {
+        final String name = super.getLocalName();
+        return NAME_CHANGES.getOrDefault(name, name);
+    }
+
+    /**
+     * Returns the namespace of current element, after replacement by the URI used by SIS.
+     * This replacement depends on the current local name in addition of current namespace.
+     */
+    @Override
+    public String getNamespaceURI() {
+        return toImplNamespace(getLocalName(), getParent().getNamespaceURI());
+    }
+
+    /**
+     * Replaces the given URI if needed, then forwards the call.
+     * If the attribute value seems to be a qualified name, replaces the namespace URI there too.
+     */
+    @Override
+    public String getAttributeValue(final String namespaceUri, final String localName) {
+        return toImplName(super.getAttributeValue(namespaceUri, localName));
+    }
+
+    /**
+     * Forwards the call.
+     * If the attribute value seems to be a qualified name, replaces the namespace URI there too.
+     */
+    @Override
+    public String getAttributeValue(int index) {
+        return toImplName(super.getAttributeValue(index));
+    }
+}

Propchange: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamResolver.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamWriter.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamWriter.java?rev=1817808&r1=1817807&r2=1817808&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamWriter.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/FilteredStreamWriter.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.xml;
 
+import java.util.Set;
+import java.util.HashSet;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.namespace.NamespaceContext;
@@ -30,7 +32,8 @@ import org.apache.sis.internal.util.Stre
  * See {@link FilteredNamespaces} for more information.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.4
  * @module
  */
@@ -41,19 +44,24 @@ final class FilteredStreamWriter extends
     private final FilterVersion version;
 
     /**
+     * Keep track of namespace URIs that have already been declared so they don't get duplicated.
+     */
+    private final Set<String> writtenNamespaceURIs;
+
+    /**
      * Creates a new filter for the given version of the standards.
      */
     FilteredStreamWriter(final XMLStreamWriter out, final FilterVersion version) {
         super(out);
         this.version = version;
+        writtenNamespaceURIs = new HashSet<>();
     }
 
     /**
      * Returns the URI to write in the XML document.
      */
     private String toView(final String uri) {
-        final String replacement = version.toView.get(uri);
-        return (replacement != null) ? replacement : uri;
+        return version.toView.getOrDefault(uri, uri);
     }
 
     /** Replaces the given URI if needed, then forwards the call. */
@@ -67,7 +75,8 @@ final class FilteredStreamWriter extends
     public void writeStartElement(final String prefix, final String localName, final String namespaceURI)
             throws XMLStreamException
     {
-        out.writeStartElement(prefix, localName, toView(namespaceURI));
+        final String view = toView(namespaceURI);
+        out.writeStartElement(Namespaces.getPreferredPrefix(view, prefix), localName, view);
     }
 
     /** Replaces the given URI if needed, then forwards the call. */
@@ -81,7 +90,8 @@ final class FilteredStreamWriter extends
     public void writeEmptyElement(final String prefix, final String localName, final String namespaceURI)
             throws XMLStreamException
     {
-        out.writeEmptyElement(prefix, localName, toView(namespaceURI));
+        final String view = toView(namespaceURI);
+        out.writeEmptyElement(Namespaces.getPreferredPrefix(view, prefix), localName, view);
     }
 
     /** Replaces the given URI if needed, then forwards the call. */
@@ -89,7 +99,8 @@ final class FilteredStreamWriter extends
     public void writeAttribute(final String prefix, final String namespaceURI, final String localName,
             final String value) throws XMLStreamException
     {
-        out.writeAttribute(prefix, toView(namespaceURI), localName, value);
+        final String view = toView(namespaceURI);
+        out.writeAttribute(Namespaces.getPreferredPrefix(view, prefix), view, localName, value);
     }
 
     /** Replaces the given URI if needed, then forwards the call. */
@@ -100,10 +111,17 @@ final class FilteredStreamWriter extends
         out.writeAttribute(toView(namespaceURI), localName, value);
     }
 
-    /** Replaces the given URI if needed, then forwards the call. */
+    /**
+     * Replaces the given URI if needed, then forwards the call.
+     * This method does nothing if the view of given URI has already be written.
+     * This filtering is applied because different URIs may be replaced by the same view.
+     */
     @Override
     public void writeNamespace(final String prefix, final String namespaceURI) throws XMLStreamException {
-        out.writeNamespace(prefix, toView(namespaceURI));
+        final String view = toView(namespaceURI);
+        if (writtenNamespaceURIs.add(view)) {
+            out.writeNamespace(Namespaces.getPreferredPrefix(view, prefix), view);
+        }
     }
 
     /** Replaces the given URI if needed, then forwards the call. */

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java?rev=1817808&r1=1817807&r2=1817808&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] Mon Dec 11 18:43:40 2017
@@ -583,7 +583,7 @@ public final class Namespaces extends St
      * Returns the preferred prefix for the given namespace URI.
      *
      * @param  namespace     the namespace URI for which the prefix needs to be found. Can not be {@code null}.
-     * @param  defaultValue  the default prefix to returned if the given {@code namespace} is not recognized,
+     * @param  defaultValue  the default prefix to return if the given {@code namespace} is not recognized,
      *                       or {@code null}.
      * @return the prefix inferred from the namespace URI, or {@code null} if the given namespace is unrecognized
      *         and the {@code defaultValue} is null.

Added: sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt?rev=1817808&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt (added)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt [UTF-8] Mon Dec 11 18:43:40 2017
@@ -0,0 +1,1328 @@
+#
+# Namespaces in which attribute are defined.
+# Lines with zero-spaces indentation are namespace URIs.
+# Lines with two-spaces  indentation are classes.
+# Lines with four-spaces indentation are attributes.
+#
+http://standards.iso.org/iso/19115/-3/cit/1.0
+  CI_Address
+    <type>
+    administrativeArea
+    city
+    country
+    deliveryPoint
+    electronicMailAddress
+    postalCode
+  CI_Citation
+    <type>
+    ISBN
+    ISSN
+    alternateTitle
+    citedResponsibleParty
+    collectiveTitle
+    date
+    edition
+    editionDate
+    graphic
+    identifier
+    onlineResource
+    otherCitationDetails
+    presentationForm
+    series
+    title
+  CI_Contact
+    <type>
+    address
+    contactInstructions
+    contactType
+    hoursOfService
+    onlineResource
+    phone
+  CI_Date
+    <type>
+    date
+    dateType
+  CI_DateTypeCode
+    <type>
+  CI_Individual
+    <type>
+    contactInfo
+    name
+    positionName
+  CI_OnLineFunctionCode
+    <type>
+  CI_OnlineResource
+    <type>
+    applicationProfile
+    description
+    function
+    linkage
+    name
+    protocol
+    protocolRequest
+  CI_Organisation
+    <type>
+    contactInfo
+    individual
+    logo
+    name
+  CI_Party
+    <type>
+    contactInfo
+    name
+  CI_Responsibility
+    <type>
+    extent
+    party
+    role
+  CI_ResponsibleParty
+    <type>
+    contactInfo
+    extent
+    individualName
+    organisationName
+    party
+    positionName
+    role
+  CI_RoleCode
+    <type>
+  CI_Series
+    <type>
+    issueIdentification
+    name
+    page
+  CI_Telephone
+    <type>
+    facsimile
+    number
+    numberType
+    voice
+  CI_TelephoneTypeCode
+    <type>
+http://standards.iso.org/iso/19115/-3/gco/1.0
+  Boolean
+    <type>
+  CharacterString
+    <type>
+  Date
+    <type>
+  DateTime
+    <type>
+  Decimal
+    <type>
+  Distance
+    <type>
+  Integer
+    <type>
+  LocalName
+    <type>
+  Measure
+    <type>
+  Real
+    <type>
+  Record
+    <type>
+  RecordType
+    <type>
+  ScopedName
+    <type>
+http://standards.iso.org/iso/19115/-3/gcx/1.0
+  Anchor
+    <type>
+  FileName
+    <type>
+  MX_DataFile
+    <type>
+    featureType
+    fileFormat
+  MimeFileType
+    <type>
+  QE_CoverageResult
+    resultFile
+http://standards.iso.org/iso/19115/-3/gex/1.0
+  EX_BoundingPolygon
+    <type>
+    extentTypeCode
+    polygon
+  EX_Extent
+    <type>
+    description
+    geographicElement
+    temporalElement
+    verticalElement
+  EX_GeographicBoundingBox
+    <type>
+    eastBoundLongitude
+    extentTypeCode
+    northBoundLatitude
+    southBoundLatitude
+    westBoundLongitude
+  EX_GeographicDescription
+    <type>
+    extentTypeCode
+    geographicIdentifier
+  EX_GeographicExtent
+    <type>
+    extentTypeCode
+  EX_SpatialTemporalExtent
+    <type>
+    extent
+    spatialExtent
+    verticalExtent
+  EX_TemporalExtent
+    <type>
+    extent
+  EX_VerticalExtent
+    <type>
+    maximumValue
+    minimumValue
+    verticalCRS
+http://standards.iso.org/iso/19115/-3/lan/1.0
+  Country
+    <type>
+  CountryCode
+    <type>
+  LanguageCode
+    <type>
+  LocalisedCharacterString
+    <type>
+  MD_CharacterSetCode
+    <type>
+  PT_Locale
+    <type>
+    characterEncoding
+    country
+    language
+    languageCode
+  textGroup
+    <type>
+http://standards.iso.org/iso/19115/-3/mac/1.0
+  MI_AcquisitionInformation
+    <type>
+    acquisitionPlan
+    acquisitionRequirement
+    environmentalConditions
+    instrument
+    objective
+    operation
+    platform
+  MI_EnvironmentalRecord
+    <type>
+    averageAirTemperature
+    maxAltitude
+    maxRelativeHumidity
+    meteorologicalConditions
+  MI_Event
+    <type>
+    context
+    expectedObjective
+    identifier
+    relatedPass
+    relatedSensor
+    sequence
+    time
+    trigger
+  MI_Instrument
+    <type>
+    citation
+    description
+    identifier
+    mountedOn
+    type
+  MI_Objective
+    <type>
+    extent
+    function
+    identifier
+    objectiveOccurence
+    pass
+    priority
+    sensingInstrument
+    type
+  MI_Operation
+    <type>
+    childOperation
+    citation
+    description
+    identifier
+    objective
+    parentOperation
+    plan
+    platform
+    significantEvent
+    status
+    type
+  MI_Plan
+    <type>
+    citation
+    operation
+    satisfiedRequirement
+    status
+    type
+  MI_Platform
+    <type>
+    citation
+    description
+    identifier
+    instrument
+    sponsor
+  MI_PlatformPass
+    <type>
+    extent
+    identifier
+    relatedEvent
+  MI_RequestedDate
+    <type>
+    latestAcceptableDate
+    requestedDateOfCollection
+  MI_Requirement
+    <type>
+    citation
+    expiryDate
+    identifier
+    priority
+    recipient
+    requestedDate
+    requestor
+    satisfiedPlan
+http://standards.iso.org/iso/19115/-3/mcc/1.0
+  MD_BrowseGraphic
+    <type>
+    fileDescription
+    fileName
+    fileType
+    imageConstraints
+    linkage
+  MD_Identifier
+    <type>
+    authority
+    code
+    codeSpace
+    description
+    version
+  MD_ScopeCode
+    <type>
+http://standards.iso.org/iso/19115/-3/mco/1.0
+  MD_Constraints
+    <type>
+    constraintApplicationScope
+    graphic
+    reference
+    releasability
+    responsibleParty
+    useLimitation
+  MD_LegalConstraints
+    <type>
+    accessConstraints
+    constraintApplicationScope
+    graphic
+    otherConstraints
+    reference
+    releasability
+    responsibleParty
+    useConstraints
+    useLimitation
+  MD_Releasability
+    <type>
+    addressee
+    disseminationConstraints
+    statement
+  MD_SecurityConstraints
+    <type>
+    classification
+    classificationSystem
+    constraintApplicationScope
+    graphic
+    handlingDescription
+    reference
+    releasability
+    responsibleParty
+    useLimitation
+    userNote
+http://standards.iso.org/iso/19115/-3/mdb/1.0
+  CI_PresentationFormCode
+    <type>
+  DQ_EvaluationMethodTypeCode
+    <type>
+  MD_ApplicationSchemaInformation
+    <type>
+    constraintLanguage
+    name
+    schemaLanguage
+    softwareDevelopmentFileFormat
+  MD_CellGeometryCode
+    <type>
+  MD_ClassificationCode
+    <type>
+  MD_FeatureTypeList
+    <type>
+    spatialObject
+    spatialSchemaName
+  MD_GeometricObjectTypeCode
+    <type>
+  MD_ImagingConditionCode
+    <type>
+  MD_KeywordTypeCode
+    <type>
+  MD_MediumFormatCode
+    <type>
+  MD_MediumNameCode
+    <type>
+  MD_Metadata
+    <type>
+    applicationSchemaInfo
+    characterSet
+    contact
+    contentInfo
+    dataQualityInfo
+    dataSetURI
+    dateInfo
+    dateStamp
+    defaultLocale
+    distributionInfo
+    fileIdentifier
+    hierarchyLevel
+    hierarchyLevelName
+    identificationInfo
+    language
+    locale
+    metadataConstraints
+    metadataExtensionInfo
+    metadataIdentifier
+    metadataMaintenance
+    metadataScope
+    metadataStandard
+    metadataStandardName
+    metadataStandardVersion
+    otherLocale
+    parentIdentifier
+    parentMetadata
+    portrayalCatalogueInfo
+    referenceSystemInfo
+    spatialRepresentationInfo
+  MD_MetadataScope
+    <type>
+    name
+    resourceScope
+  MD_ObligationCode
+    <type>
+  MD_PortrayalCatalogueReference
+    <type>
+    portrayalCatalogueCitation
+  MD_ProgressCode
+    <type>
+  MD_RestrictionCode
+    <type>
+  MD_SpatialRepresentationTypeCode
+    <type>
+  MD_TopicCategoryCode
+    <type>
+  MD_TopologyLevelCode
+    <type>
+  MI_Metadata
+    acquisitionInformation
+    applicationSchemaInfo
+    characterSet
+    contact
+    contentInfo
+    dataQualityInfo
+    dataSetURI
+    dateInfo
+    dateStamp
+    defaultLocale
+    distributionInfo
+    fileIdentifier
+    hierarchyLevel
+    hierarchyLevelName
+    identificationInfo
+    language
+    locale
+    metadataConstraints
+    metadataExtensionInfo
+    metadataIdentifier
+    metadataMaintenance
+    metadataScope
+    metadataStandard
+    metadataStandardName
+    metadataStandardVersion
+    otherLocale
+    parentIdentifier
+    parentMetadata
+    portrayalCatalogueInfo
+    referenceSystemInfo
+    spatialRepresentationInfo
+  RS_Identifier
+    <type>
+    authority
+    code
+    codeSpace
+    version
+  URL
+    <type>
+http://standards.iso.org/iso/19115/-3/mex/1.0
+  MD_DatatypeCode
+    <type>
+  MD_ExtendedElementInformation
+    <type>
+    condition
+    dataType
+    definition
+    domainCode
+    domainValue
+    maximumOccurrence
+    name
+    obligation
+    parentEntity
+    rationale
+    rule
+    shortName
+    source
+  MD_MetadataExtensionInformation
+    <type>
+    extendedElementInformation
+    extensionOnLineResource
+http://standards.iso.org/iso/19115/-3/mmi/1.0
+  DQ_Scope
+    extent
+    level
+  MD_MaintenanceFrequencyCode
+    <type>
+  MD_MaintenanceInformation
+    <type>
+    contact
+    dateOfNextUpdate
+    maintenanceAndUpdateFrequency
+    maintenanceDate
+    maintenanceNote
+    maintenanceScope
+    updateScope
+    updateScopeDescription
+    userDefinedMaintenanceFrequency
+  MD_Scope
+    <type>
+    extent
+    level
+    levelDescription
+  MD_ScopeDescription
+    <type>
+    dataset
+    other
+http://standards.iso.org/iso/19115/-3/mrc/1.0
+  MD_AttributeGroup
+    <type>
+    attribute
+    contentType
+  MD_Band
+    <type>
+    bitsPerValue
+    description
+    descriptor
+    maxValue
+    meanValue
+    minValue
+    name
+    numberOfValues
+    offset
+    otherProperty
+    otherPropertyType
+    peakResponse
+    scaleFactor
+    sequenceIdentifier
+    standardDeviation
+    toneGradation
+    units
+  MD_ContentInformation
+    <type>
+  MD_CoverageContentTypeCode
+    <type>
+  MD_CoverageDescription
+    <type>
+    attributeDescription
+    attributeGroup
+    contentType
+    dimension
+    processingLevelCode
+    rangeElementDescription
+  MD_FeatureCatalogueDescription
+    <type>
+    complianceCode
+    featureCatalogueCitation
+    featureTypes
+    includedWithDataset
+    language
+  MD_FeatureTypeInfo
+    <type>
+    featureInstanceCount
+    featureTypeName
+  MD_ImageDescription
+    <type>
+    attributeDescription
+    attributeGroup
+    cameraCalibrationInformationAvailability
+    cloudCoverPercentage
+    compressionGenerationQuantity
+    contentType
+    dimension
+    filmDistortionInformationAvailability
+    illuminationAzimuthAngle
+    illuminationElevationAngle
+    imageQualityCode
+    imagingCondition
+    lensDistortionInformationAvailability
+    processingLevelCode
+    radiometricCalibrationDataAvailability
+    rangeElementDescription
+    triangulationIndicator
+  MD_RangeDimension
+    <type>
+    description
+    descriptor
+    name
+    sequenceIdentifier
+  MD_SampleDimension
+    <type>
+    bitsPerValue
+    description
+    descriptor
+    maxValue
+    meanValue
+    minValue
+    name
+    numberOfValues
+    offset
+    otherProperty
+    otherPropertyType
+    scaleFactor
+    sequenceIdentifier
+    standardDeviation
+    units
+  MI_Band
+    bandBoundaryDefinition
+    bitsPerValue
+    description
+    descriptor
+    detectedPolarization
+    maxValue
+    meanValue
+    minValue
+    name
+    nominalSpatialResolution
+    numberOfValues
+    offset
+    otherProperty
+    otherPropertyType
+    peakResponse
+    scaleFactor
+    sequenceIdentifier
+    standardDeviation
+    toneGradation
+    transferFunctionType
+    transmittedPolarization
+    units
+  MI_CoverageDescription
+    attributeDescription
+    attributeGroup
+    contentType
+    dimension
+    processingLevelCode
+    rangeElementDescription
+  MI_ImageDescription
+    attributeDescription
+    attributeGroup
+    cameraCalibrationInformationAvailability
+    cloudCoverPercentage
+    compressionGenerationQuantity
+    contentType
+    dimension
+    filmDistortionInformationAvailability
+    illuminationAzimuthAngle
+    illuminationElevationAngle
+    imageQualityCode
+    imagingCondition
+    lensDistortionInformationAvailability
+    processingLevelCode
+    radiometricCalibrationDataAvailability
+    rangeElementDescription
+    triangulationIndicator
+http://standards.iso.org/iso/19115/-3/mrd/1.0
+  MD_DigitalTransferOptions
+    <type>
+    offLine
+    onLine
+    transferSize
+    unitsOfDistribution
+  MD_Distribution
+    <type>
+    distributionFormat
+    distributor
+    transferOptions
+  MD_Distributor
+    <type>
+    distributionOrderProcess
+    distributorContact
+    distributorFormat
+    distributorTransferOptions
+  MD_Format
+    <type>
+    amendmentNumber
+    fileDecompressionTechnique
+    formatDistributor
+    formatSpecificationCitation
+    medium
+    name
+    specification
+    version
+  MD_Medium
+    <type>
+    density
+    densityUnits
+    mediumFormat
+    mediumNote
+    name
+    volumes
+  MD_StandardOrderProcess
+    <type>
+    fees
+    orderingInstructions
+    plannedAvailableDateTime
+    turnaround
+http://standards.iso.org/iso/19115/-3/mri/1.0
+  DS_AssociationTypeCode
+    <type>
+  DS_InitiativeTypeCode
+    <type>
+  MD_AggregateInformation
+    <type>
+    aggregateDataSetIdentifier
+    aggregateDataSetName
+    associationType
+    initiativeType
+    metadataReference
+    name
+  MD_AssociatedResource
+    <type>
+    associationType
+    initiativeType
+    metadataReference
+    name
+  MD_DataIdentification
+    <type>
+    abstract
+    additionalDocumentation
+    aggregationInfo
+    associatedResource
+    characterSet
+    citation
+    credit
+    defaultLocale
+    descriptiveKeywords
+    environmentDescription
+    extent
+    graphicOverview
+    language
+    otherLocale
+    pointOfContact
+    processingLevel
+    purpose
+    resourceConstraints
+    resourceFormat
+    resourceMaintenance
+    resourceSpecificUsage
+    spatialRepresentationType
+    spatialResolution
+    status
+    supplementalInformation
+    temporalResolution
+    topicCategory
+  MD_Identification
+    <type>
+    abstract
+    additionalDocumentation
+    aggregationInfo
+    associatedResource
+    citation
+    credit
+    descriptiveKeywords
+    extent
+    graphicOverview
+    pointOfContact
+    processingLevel
+    purpose
+    resourceConstraints
+    resourceFormat
+    resourceMaintenance
+    resourceSpecificUsage
+    spatialRepresentationType
+    spatialResolution
+    status
+    temporalResolution
+    topicCategory
+  MD_KeywordClass
+    <type>
+    className
+    conceptIdentifier
+    ontology
+  MD_Keywords
+    <type>
+    keyword
+    keywordClass
+    thesaurusName
+    type
+  MD_RepresentativeFraction
+    <type>
+    denominator
+  MD_Resolution
+    <type>
+    distance
+    equivalentScale
+  MD_Usage
+    <type>
+    additionalDocumentation
+    identifiedIssues
+    response
+    specificUsage
+    usageDateTime
+    userContactInfo
+    userDeterminedLimitations
+  SV_ServiceIdentification
+    abstract
+    additionalDocumentation
+    aggregationInfo
+    associatedResource
+    citation
+    credit
+    descriptiveKeywords
+    extent
+    graphicOverview
+    pointOfContact
+    processingLevel
+    purpose
+    resourceConstraints
+    resourceFormat
+    resourceMaintenance
+    resourceSpecificUsage
+    spatialRepresentationType
+    spatialResolution
+    status
+    temporalResolution
+    topicCategory
+http://standards.iso.org/iso/19115/-3/mrl/1.0
+  LE_ProcessStep
+    dateTime
+    description
+    output
+    processingInformation
+    processor
+    rationale
+    report
+    source
+  LE_Source
+    description
+    processedLevel
+    resolution
+    scaleDenominator
+    sourceCitation
+    sourceExtent
+    sourceStep
+  LI_Lineage
+    <type>
+    processStep
+    source
+    statement
+  LI_ProcessStep
+    <type>
+    dateTime
+    description
+    processor
+    rationale
+    source
+  LI_Source
+    <type>
+    description
+    scaleDenominator
+    sourceCitation
+    sourceExtent
+    sourceStep
+http://standards.iso.org/iso/19115/-3/mrs/1.0
+  MD_ReferenceSystem
+    <type>
+    referenceSystemIdentifier
+http://standards.iso.org/iso/19115/-3/msr/1.0
+  MD_Dimension
+    <type>
+    dimensionName
+    dimensionSize
+    resolution
+  MD_DimensionNameTypeCode
+    <type>
+  MD_GeometricObjects
+    <type>
+    geometricObjectCount
+    geometricObjectType
+  MD_Georectified
+    <type>
+    axisDimensionProperties
+    cellGeometry
+    centerPoint
+    checkPointAvailability
+    checkPointDescription
+    cornerPoints
+    numberOfDimensions
+    pointInPixel
+    transformationDimensionDescription
+    transformationDimensionMapping
+    transformationParameterAvailability
+  MD_Georeferenceable
+    <type>
+    axisDimensionProperties
+    cellGeometry
+    controlPointAvailability
+    numberOfDimensions
+    orientationParameterAvailability
+    orientationParameterDescription
+    parameterCitation
+    transformationParameterAvailability
+  MD_GridSpatialRepresentation
+    <type>
+    axisDimensionProperties
+    cellGeometry
+    numberOfDimensions
+    transformationParameterAvailability
+  MD_PixelOrientationCode
+    <type>
+  MD_SpatialRepresentation
+    <type>
+  MD_VectorSpatialRepresentation
+    <type>
+    geometricObjects
+    topologyLevel
+  MI_Georectified
+    axisDimensionProperties
+    cellGeometry
+    centerPoint
+    checkPoint
+    checkPointAvailability
+    checkPointDescription
+    cornerPoints
+    numberOfDimensions
+    pointInPixel
+    transformationDimensionDescription
+    transformationDimensionMapping
+    transformationParameterAvailability
+  MI_Georeferenceable
+    axisDimensionProperties
+    cellGeometry
+    controlPointAvailability
+    geolocationInformation
+    numberOfDimensions
+    orientationParameterAvailability
+    orientationParameterDescription
+    parameterCitation
+    transformationParameterAvailability
+http://standards.iso.org/iso/19115/-3/srv/2.0
+  DCPList
+    <type>
+  SV_CoupledResource
+    <type>
+    identifier
+    operation
+    operationName
+    resource
+    resourceReference
+  SV_CouplingType
+    <type>
+  SV_OperationChainMetadata
+    <type>
+    description
+    name
+    operation
+  SV_OperationMetadata
+    <type>
+    DCP
+    connectPoint
+    dependsOn
+    distributedComputingPlatform
+    invocationName
+    operationDescription
+    operationName
+    parameters
+  SV_Parameter
+    <type>
+    description
+    direction
+    name
+    optionality
+    repeatability
+    valueType
+  SV_ParameterDirection
+    <type>
+  SV_ServiceIdentification
+    <type>
+    accessProperties
+    containsChain
+    containsOperations
+    coupledResource
+    couplingType
+    operatedDataset
+    operatesOn
+    profile
+    serviceStandard
+    serviceType
+    serviceTypeVersion
+http://standards.iso.org/iso/19157/-2/dqc/1.0
+  DQ_AbsoluteExternalPositionalAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_AccuracyOfATimeMeasurement
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_Completeness
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_CompletenessCommission
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_CompletenessOmission
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_ConceptualConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_ConformanceResult
+    <type>
+    explanation
+    pass
+    specification
+  DQ_DataQuality
+    <type>
+    lineage
+    report
+    scope
+  DQ_DomainConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_Element
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_FormatConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_GriddedDataPositionalAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_LogicalConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_NonQuantitativeAttributeAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_PositionalAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_QuantitativeAttributeAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_QuantitativeResult
+    <type>
+    errorStatistic
+    valueType
+    valueUnit
+  DQ_RelativeInternalPositionalAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_Result
+    <type>
+  DQ_Scope
+    <type>
+    levelDescription
+  DQ_TemporalAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_TemporalConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_TemporalValidity
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_ThematicAccuracy
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_ThematicClassificationCorrectness
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  DQ_TopologicalConsistency
+    <type>
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+  QE_Usability
+    dateTime
+    evaluationMethodDescription
+    evaluationMethodType
+    evaluationProcedure
+    measureDescription
+    measureIdentification
+    nameOfMeasure
+    result
+http://www.isotc211.org/2005/gmi
+  LE_Algorithm
+    <type>
+    citation
+    description
+  LE_NominalResolution
+    <type>
+    groundResolution
+    scanningResolution
+  LE_ProcessStep
+    <type>
+  LE_ProcessStepReport
+    <type>
+    description
+    fileType
+    name
+  LE_Processing
+    <type>
+    algorithm
+    documentation
+    identifier
+    procedureDescription
+    runTimeParameters
+    softwareReference
+  LE_Source
+    <type>
+  LI_ProcessStep
+    output
+    processingInformation
+    report
+  LI_Source
+    processedLevel
+    resolution
+  MD_Band
+    bandBoundaryDefinition
+    detectedPolarization
+    nominalSpatialResolution
+    transferFunctionType
+    transmittedPolarization
+  MD_Georectified
+    checkPoint
+  MD_Georeferenceable
+    geolocationInformation
+  MD_Metadata
+    acquisitionInformation
+  MI_Band
+    <type>
+  MI_BandDefinition
+    <type>
+  MI_ContextCode
+    <type>
+  MI_CoverageDescription
+    <type>
+  MI_GCP
+    <type>
+    accuracyReport
+  MI_GCPCollection
+    <type>
+    collectionIdentification
+    collectionName
+    coordinateReferenceSystem
+    gcp
+    qualityInfo
+  MI_GeolocationInformation
+    <type>
+    qualityInfo
+  MI_GeometryTypeCode
+    <type>
+  MI_Georectified
+    <type>
+  MI_Georeferenceable
+    <type>
+  MI_ImageDescription
+    <type>
+  MI_Metadata
+    <type>
+  MI_ObjectiveTypeCode
+    <type>
+  MI_OperationTypeCode
+    <type>
+  MI_PolarizationOrientationCode
+    <type>
+  MI_PriorityCode
+    <type>
+  MI_RangeElementDescription
+    <type>
+    definition
+    name
+  MI_SequenceCode
+    <type>
+  MI_TransferFunctionTypeCode
+    <type>
+  MI_TriggerCode
+    <type>
+  QE_CoverageResult
+    <type>
+    resultContentDescription
+    resultFormat
+    resultSpatialRepresentation
+    spatialRepresentationType
+  QE_Usability
+    <type>
+http://www.isotc211.org/2005/gts
+  TM_Duration
+    <type>
+  TM_PeriodDuration
+    <type>
+http://www.opengis.net/gml/3.2
+  TimeInstant
+    <type>
+    timePosition
+  TimePeriod
+    <type>
+    begin
+    beginPosition
+    end
+    endPosition

Propchange: sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message