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

svn commit: r1399614 [1/3] - in /sis/trunk: ./ sis-utility/src/main/java/org/apache/sis/internal/jaxb/ sis-utility/src/main/java/org/apache/sis/util/ sis-utility/src/main/java/org/apache/sis/xml/ sis-utility/src/test/java/org/apache/sis/test/suite/ sis...

Author: desruisseaux
Date: Thu Oct 18 12:27:10 2012
New Revision: 1399614

URL: http://svn.apache.org/viewvc?rev=1399614&view=rev
Log:
Merge from the JDK6 branch.

Added:
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java
      - copied unchanged from r1399609, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
      - copied unchanged from r1399609, sis/branches/JDK6/sis-utility/src/main/java/org/apache/sis/util/LenientComparable.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java
      - copied unchanged from r1399609, sis/branches/JDK6/sis-utility/src/test/java/org/apache/sis/util/UtilitiesTest.java
    sis/trunk/src/main/docbook/fr/XML.xml
      - copied unchanged from r1399609, sis/branches/JDK6/src/main/docbook/fr/XML.xml
Modified:
    sis/trunk/   (props changed)
    sis/trunk/pom.xml
    sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java
    sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
    sis/trunk/sis-utility/src/test/java/org/apache/sis/xml/XLinkTest.java
    sis/trunk/src/main/docbook/book.entities
    sis/trunk/src/main/docbook/book.xsl
    sis/trunk/src/main/docbook/fr.xml
    sis/trunk/src/main/docbook/fr/geoapi.xml
    sis/trunk/src/main/docbook/fr/introduction.xml
    sis/trunk/src/main/docbook/fr/standards.xml
    sis/trunk/src/site/resources/book/book.css

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1398733-1399602
  Merged /sis/branches/JDK6:r1398736-1399609

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Thu Oct 18 12:27:10 2012
@@ -476,7 +476,7 @@ Apache SIS is a toolkit for describing l
             </group>
             <group>
               <title>Utilities</title>
-              <packages>org.apache.sis.math*:org.apache.sis.util*:org.apache.sis.io*</packages>
+              <packages>org.apache.sis.math*:org.apache.sis.util*:org.apache.sis.io*:org.apache.sis.xml*</packages>
             </group>
           </groups>
 
@@ -487,7 +487,7 @@ Apache SIS is a toolkit for describing l
           <tags>
             <tag><placement>t</placement> <name>goal</name>     <head>Maven goal:</head></tag>
             <tag><placement>t</placement> <name>phase</name>    <head>Maven phase:</head></tag>
-            <tag><placement>m</placement> <name>category</name> <head>Category:</head></tag>
+            <tag><placement>a</placement> <name>category</name> <head>Category:</head></tag>
             <tag><placement>a</placement> <name>todo</name>     <head>TODO:</head></tag>
           </tags>
           <taglets>

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java Thu Oct 18 12:27:10 2012
@@ -39,7 +39,7 @@ import static org.apache.sis.util.collec
 
 /**
  * A map of identifiers which can be used as a helper class for
- * {@link org.geotoolkit.xml.IdentifiedObject} implementations.
+ * {@link org.apache.sis.xml.IdentifiedObject} implementations.
  *
  * <p>This class works as a wrapper around a collection of identifiers. Because all operations
  * are performed by an iteration over the collection elements, this implementation is suitable
@@ -76,7 +76,7 @@ import static org.apache.sis.util.collec
  * @version 0.3
  * @module
  *
- * @see org.geotoolkit.xml.IdentifiedObject
+ * @see org.apache.sis.xml.IdentifiedObject
  */
 public class IdentifierMapAdapter extends AbstractMap<Citation,String> implements IdentifierMap, Serializable {
     /**

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/util/Utilities.java Thu Oct 18 12:27:10 2012
@@ -17,6 +17,14 @@
 package org.apache.sis.util;
 
 import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+// Related to JDK7
+import org.apache.sis.internal.util.Objects;
 
 
 /**
@@ -65,6 +73,184 @@ public final class Utilities extends Sta
     }
 
     /**
+     * Convenience method for testing two objects for equality using the given level of strictness.
+     * If at least one of the given objects implement the {@link LenientComparable} interface, then
+     * the comparison is performed using the {@link LenientComparable#equals(Object, ComparisonMode)}
+     * method. Otherwise this method performs the same work than the
+     * {@link Objects#deepEquals(Object, Object)} convenience method.
+     * <p>
+     * If both arguments are arrays or collections, then the elements are compared recursively.
+     *
+     * @param  object1 The first object to compare, or {@code null}.
+     * @param  object2 The second object to compare, or {@code null}.
+     * @param  mode    The strictness level of the comparison.
+     * @return {@code true} if both objects are equal for the given level of strictness.
+     *
+     * @see org.apache.sis.referencing.CRS#equalsIgnoreMetadata(Object, Object)
+     */
+    public static boolean deepEquals(final Object object1, final Object object2, final ComparisonMode mode) {
+        if (object1 == object2) {
+            return true;
+        }
+        if (object1 == null || object2 == null) {
+            assert isNotDebug(mode) : "object" + (object1 == null ? '1' : '2') + " is null";
+            return false;
+        }
+        if (object1 instanceof LenientComparable) {
+            return ((LenientComparable) object1).equals(object2, mode);
+        }
+        if (object2 instanceof LenientComparable) {
+            return ((LenientComparable) object2).equals(object1, mode);
+        }
+        if (object1 instanceof Map.Entry<?,?>) {
+            if (object2 instanceof Map.Entry<?,?>) {
+                final Map.Entry<?,?> e1 = (Map.Entry<?,?>) object1;
+                final Map.Entry<?,?> e2 = (Map.Entry<?,?>) object2;
+                return deepEquals(e1.getKey(),   e2.getKey(),   mode) &&
+                       deepEquals(e1.getValue(), e2.getValue(), mode);
+            }
+            assert isNotDebug(mode) : mismatchedType(Map.Entry.class, object2);
+            return false;
+        }
+        if (object1 instanceof Map<?,?>) {
+            if (object2 instanceof Map<?,?>) {
+                return equals(((Map<?,?>) object1).entrySet(),
+                              ((Map<?,?>) object2).entrySet(), mode);
+            }
+            assert isNotDebug(mode) : mismatchedType(Map.class, object2);
+            return false;
+        }
+        if (object1 instanceof Collection<?>) {
+            if (object2 instanceof Collection<?>) {
+                return equals((Collection<?>) object1,
+                              (Collection<?>) object2, mode);
+            }
+            assert isNotDebug(mode) : mismatchedType(Collection.class, object2);
+            return false;
+        }
+        if (object1 instanceof Object[]) {
+            if (!(object2 instanceof Object[])) {
+                assert isNotDebug(mode) : mismatchedType(Object[].class, object2);
+                return false;
+            }
+            final Object[] array1 = (Object[]) object1;
+            final Object[] array2 = (Object[]) object2;
+            if (array1 instanceof LenientComparable[]) {
+                return equals((LenientComparable[]) array1, array2, mode);
+            }
+            if (array2 instanceof LenientComparable[]) {
+                return equals((LenientComparable[]) array2, array1, mode);
+            }
+            final int length = array1.length;
+            if (array2.length != length) {
+                assert isNotDebug(mode) : "Length " + length + " != " + array2.length;
+                return false;
+            }
+            for (int i=0; i<length; i++) {
+                if (!deepEquals(array1[i], array2[i], mode)) {
+                    assert isNotDebug(mode) : "object[" + i + "] not equal";
+                    return false;
+                }
+            }
+            return true;
+        }
+        return Objects.deepEquals(object1, object2);
+    }
+
+    /**
+     * Compares two arrays where at least one array is known to contain {@link LenientComparable}
+     * elements. This knowledge avoid the need to test each element individually. The two arrays
+     * shall be non-null.
+     */
+    private static boolean equals(final LenientComparable[] array1, final Object[] array2, final ComparisonMode mode) {
+        final int length = array1.length;
+        if (array2.length != length) {
+            return false;
+        }
+        for (int i=0; i<length; i++) {
+            final LenientComparable e1 = array1[i];
+            final Object e2 = array2[i];
+            if (e1 != e2 && (e1 == null || !e1.equals(e2, mode))) {
+                assert isNotDebug(mode) : "object[" + i + "] not equal";
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Compares two collections. Order are significant, unless both collections implement the
+     * {@link Set} interface.
+     */
+    private static boolean equals(final Iterable<?> object1, final Iterable<?> object2, final ComparisonMode mode) {
+        final Iterator<?> it1 = object1.iterator();
+        final Iterator<?> it2 = object2.iterator();
+        while (it1.hasNext()) {
+            if (!it2.hasNext()) {
+                assert isNotDebug(mode) : "Sizes not equal";
+                return false;
+            }
+            Object element1 = it1.next();
+            Object element2 = it2.next();
+            if (deepEquals(element1, element2, mode)) {
+                continue;
+            }
+            if (!(object1 instanceof Set<?> && object2 instanceof Set<?>)) {
+                assert isNotDebug(mode) : "Lists not equal";
+                return false;
+            }
+            /*
+             * We have found an element which is not equals. However in the particular
+             * case of Set, the element order is not significant. So we need to perform
+             * a more costly check ensuring that the collections are still different if
+             * ignoring order. Note that the test will ignore the elements successfuly
+             * compared up to this point.
+             */
+            // Creates a copy of REMAINING elements in the first collection.
+            final LinkedList<Object> copy = new LinkedList<Object>();
+            copy.add(element1);
+            while (it1.hasNext()) {
+                copy.add(it1.next());
+            }
+            // Removes from the above copy all REMAINING elements from the second collection.
+            while (true) {
+                final Iterator<?> it = copy.iterator();
+                do if (!it.hasNext()) {
+                    assert isNotDebug(mode) : "Sets not equal";
+                    return false; // An element has not been found.
+                } while (!deepEquals(it.next(), element2, mode));
+                it.remove();
+                if (!it2.hasNext()) {
+                    break;
+                }
+                element2 = it2.next();
+            }
+            return copy.isEmpty();
+        }
+        return !it2.hasNext();
+    }
+
+    /**
+     * Returns {@code true} if the given mode is not {@link ComparisonMode#DEBUG}. In debug mode,
+     * the expected behavior of {@link #deepEquals(Object, Object, ComparisonMode)} is to thrown
+     * an exception (rather then returning {@code false}) when two objects are not equal.
+     */
+    private static boolean isNotDebug(final ComparisonMode mode) {
+        return mode != ComparisonMode.DEBUG;
+    }
+
+    /**
+     * Returns an assertion error message for mismatched types.
+     *
+     * @param  expected The expected type.
+     * @param  actual The actual object (not its type).
+     * @return The error message to use in assertions.
+     */
+    private static String mismatchedType(final Class<?> expected, final Object actual) {
+        return "Expected " + expected + " but got " + actual.getClass();
+    }
+
+    /**
      * Returns a hash code for the specified object, which may be an array.
      * This method returns one of the following values:
      * <p>

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifiedObject.java Thu Oct 18 12:27:10 2012
@@ -64,7 +64,7 @@ import org.opengis.metadata.citation.Cit
  * @module
  *
  * @see IdentifierSpace
- * @see org.geotoolkit.metadata.iso.MetadataEntity
+ * @see org.apache.sis.metadata.iso.MetadataEntity
  * @see ObjectLinker#newIdentifiedObject(Class, Identifier[])
  */
 public interface IdentifiedObject {
@@ -74,13 +74,13 @@ public interface IdentifiedObject {
      * authority} name space. Examples of namespace are:
      * <p>
      * <ul>
-     *   <li>{@linkplain org.geotoolkit.metadata.iso.citation.Citations#EPSG EPSG} codes</li>
+     *   <li>{@linkplain org.apache.sis.metadata.iso.citation.Citations#EPSG EPSG} codes</li>
      *   <li><cite>Universal Product Code</cite> (UPC)</li>
      *   <li><cite>National Stock Number</cite> (NSN)</li>
      *   <li><cite>International Standard Book Number</cite>
-     *       ({@linkplain org.geotoolkit.metadata.iso.citation.Citations#ISBN ISBN})</li>
+     *       ({@linkplain org.apache.sis.metadata.iso.citation.Citations#ISBN ISBN})</li>
      *   <li><cite>International Standard Serial Number</cite>
-     *       ({@linkplain org.geotoolkit.metadata.iso.citation.Citations#ISSN ISSN})</li>
+     *       ({@linkplain org.apache.sis.metadata.iso.citation.Citations#ISSN ISSN})</li>
      *   <li><cite>Universally Unique Identifier</cite> ({@linkplain java.util.UUID})</li>
      *   <li>XML {@linkplain IdentifierSpace#ID ID} attribute</li>
      *   <li>{@linkplain XLink} ({@code href}, {@code role}, {@code arcrole}, {@code title},
@@ -92,9 +92,9 @@ public interface IdentifiedObject {
      *
      * @return All identifiers associated to this object, or an empty collection if none.
      *
-     * @see org.geotoolkit.metadata.iso.citation.DefaultCitation#getIdentifiers()
-     * @see org.geotoolkit.metadata.iso.acquisition.DefaultObjective#getIdentifiers()
-     * @see org.geotoolkit.referencing.AbstractIdentifiedObject#getIdentifiers()
+     * @see org.apache.sis.metadata.iso.citation.DefaultCitation#getIdentifiers()
+     * @see org.apache.sis.metadata.iso.acquisition.DefaultObjective#getIdentifiers()
+     * @see org.apache.sis.referencing.AbstractIdentifiedObject#getIdentifiers()
      */
     Collection<? extends Identifier> getIdentifiers();
 
@@ -110,15 +110,15 @@ public interface IdentifiedObject {
      * <p>There is usually a one-to-one relationship between the map entries and the identifier
      * elements, but not always:</p>
      * <ul>
-     *   <li><p>The map view may contain less entries, because the map interface allows only one
+     *   <li>The map view may contain less entries, because the map interface allows only one
      *   entry per authority. If the {@linkplain #getIdentifiers() identifier collection} contains
      *   many identifiers for the same authority, then only the first occurrence is visible through
-     *   this {@code Map} view.</p></li>
+     *   this {@code Map} view.</li>
      *
-     *   <li><p>The map view may also contain more entries than the {@linkplain #getIdentifiers()
+     *   <li>The map view may also contain more entries than the {@linkplain #getIdentifiers()
      *   identifier collection}. For example the {@link org.opengis.metadata.citation.Citation}
      *   interface defines separated attributes for ISBN, ISSN and other identifiers. This map
-     *   view may choose to unify all those attributes in a single view.</p></li>
+     *   view may choose to unify all those attributes in a single view.</li>
      * </ul>
      *
      * <p>The map supports {@link IdentifierMap#put(Object, Object) put} operations

Modified: sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java (original)
+++ sis/trunk/sis-utility/src/main/java/org/apache/sis/xml/IdentifierSpace.java Thu Oct 18 12:27:10 2012
@@ -100,15 +100,15 @@ public interface IdentifierSpace<T> exte
 
     /**
      * Returns the name of this identifier space.
-     *
+     * <p>
      * <ul>
-     *   <li><p>For the constants defined in this {@code IdentifierSpace} interface, this is
+     *   <li>For the constants defined in this {@code IdentifierSpace} interface, this is
      *       the XML attribute name with its prefix. Attribute names can be {@code "gml:id"},
-     *       {@code "gco:uuid"} or {@code "xlink:href"}.</p></li>
+     *       {@code "gco:uuid"} or {@code "xlink:href"}.</li>
      *
-     *   <li><p>For the constants defined in the {@link org.apache.sis.metadata.iso.citation.Citations}
+     *   <li>For the constants defined in the {@link org.apache.sis.metadata.iso.citation.Citations}
      *       class, this is the identifier namespace. They are usually not XML attribute name because those
-     *       identifiers are marshalled as {@code <MD_Identifier>} XML elements rather than attributes.</p></li>
+     *       identifiers are marshalled as {@code <MD_Identifier>} XML elements rather than attributes.</li>
      * </ul>
      *
      * @return The name of this identifier space (may be XML attribute name).

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java Thu Oct 18 12:27:10 2012
@@ -34,6 +34,7 @@ import org.junit.runners.Suite;
   org.apache.sis.internal.test.XMLComparatorTest.class,
 
   // Following are testing the actual SIS library.
+  org.apache.sis.util.UtilitiesTest.class,
   org.apache.sis.util.ArraysTest.class,
   org.apache.sis.util.CharactersTest.class,
   org.apache.sis.util.CharSequencesTest.class,

Modified: sis/trunk/sis-utility/src/test/java/org/apache/sis/xml/XLinkTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/sis-utility/src/test/java/org/apache/sis/xml/XLinkTest.java?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/sis-utility/src/test/java/org/apache/sis/xml/XLinkTest.java (original)
+++ sis/trunk/sis-utility/src/test/java/org/apache/sis/xml/XLinkTest.java Thu Oct 18 12:27:10 2012
@@ -52,45 +52,45 @@ public final strictfp class XLinkTest ex
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
-        link.setRole(new URI("org:geotoolkit:role"));
+        link.setRole(new URI("org:apache:sis:role"));
         assertEquals(XLink.Type.EXTENDED, link.getType());
-        assertEquals("XLink[type=\"extended\", role=\"org:geotoolkit:role\"]", link.toString());
+        assertEquals("XLink[type=\"extended\", role=\"org:apache:sis:role\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
         link.setTitle(new SimpleInternationalString("Some title"));
         assertEquals(XLink.Type.EXTENDED, link.getType());
-        assertEquals("XLink[type=\"extended\", role=\"org:geotoolkit:role\", title=\"Some title\"]", link.toString());
+        assertEquals("XLink[type=\"extended\", role=\"org:apache:sis:role\", title=\"Some title\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
         link.setLabel("SomeLabel");
         assertEquals(XLink.Type.RESOURCE, link.getType());
-        assertEquals("XLink[type=\"resource\", role=\"org:geotoolkit:role\", title=\"Some title\", label=\"SomeLabel\"]", link.toString());
+        assertEquals("XLink[type=\"resource\", role=\"org:apache:sis:role\", title=\"Some title\", label=\"SomeLabel\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
-        link.setHRef(new URI("org:geotoolkit:href"));
+        link.setHRef(new URI("org:apache:sis:href"));
         assertEquals(XLink.Type.LOCATOR, link.getType());
-        assertEquals("XLink[type=\"locator\", href=\"org:geotoolkit:href\", role=\"org:geotoolkit:role\", title=\"Some title\", label=\"SomeLabel\"]", link.toString());
+        assertEquals("XLink[type=\"locator\", href=\"org:apache:sis:href\", role=\"org:apache:sis:role\", title=\"Some title\", label=\"SomeLabel\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
         link.setShow(XLink.Show.NEW);
         assertNull("Can't be Type.SIMPLE if a label is defined.", link.getType());
-        assertEquals("XLink[href=\"org:geotoolkit:href\", role=\"org:geotoolkit:role\", title=\"Some title\", show=\"new\", label=\"SomeLabel\"]", link.toString());
+        assertEquals("XLink[href=\"org:apache:sis:href\", role=\"org:apache:sis:role\", title=\"Some title\", show=\"new\", label=\"SomeLabel\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
         link.setLabel(null);
         assertEquals(XLink.Type.SIMPLE, link.getType());
-        assertEquals("XLink[type=\"simple\", href=\"org:geotoolkit:href\", role=\"org:geotoolkit:role\", title=\"Some title\", show=\"new\"]", link.toString());
+        assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\", role=\"org:apache:sis:role\", title=\"Some title\", show=\"new\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
 
         link.setActuate(XLink.Actuate.ON_LOAD);
         assertEquals(XLink.Type.SIMPLE, link.getType());
-        assertEquals("XLink[type=\"simple\", href=\"org:geotoolkit:href\", role=\"org:geotoolkit:role\", title=\"Some title\", show=\"new\", actuate=\"onLoad\"]", link.toString());
+        assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\", role=\"org:apache:sis:role\", title=\"Some title\", show=\"new\", actuate=\"onLoad\"]", link.toString());
         assertFalse("Hash code should have changed.", hashCode == (hashCode = link.hashCode()));
         assertFalse("Hash code can not be zero.", hashCode == 0);
         /*
@@ -116,8 +116,8 @@ public final strictfp class XLinkTest ex
     public void testWrite() throws URISyntaxException {
         final XLink link = new XLink();
         link.setType(XLink.Type.SIMPLE);
-        link.setHRef(new URI("org:geotoolkit:href"));
-        assertEquals("XLink[type=\"simple\", href=\"org:geotoolkit:href\"]", link.toString());
+        link.setHRef(new URI("org:apache:sis:href"));
+        assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\"]", link.toString());
         try {
             link.setLabel("SomeLabel");
             fail("Should not be allowed to set the label.");
@@ -126,7 +126,7 @@ public final strictfp class XLinkTest ex
             assertTrue(e.getMessage().contains("label"));
             assertTrue(e.getMessage().contains("simple"));
         }
-        assertEquals("XLink[type=\"simple\", href=\"org:geotoolkit:href\"]", link.toString());
+        assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\"]", link.toString());
         try {
             link.setType(XLink.Type.EXTENDED);
             fail("Should not be allowed to set a type that does not include HREF.");
@@ -134,13 +134,13 @@ public final strictfp class XLinkTest ex
             // This is the expected exception. The message should contains the type name.
             assertTrue(e.getMessage().contains("extended"));
         }
-        assertEquals("XLink[type=\"simple\", href=\"org:geotoolkit:href\"]", link.toString());
+        assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\"]", link.toString());
         /*
          * The Locator type contains the HREF attribute, so the following operation should be
          * allowed.
          */
         link.setType(XLink.Type.LOCATOR);
-        assertEquals("XLink[type=\"locator\", href=\"org:geotoolkit:href\"]", link.toString());
+        assertEquals("XLink[type=\"locator\", href=\"org:apache:sis:href\"]", link.toString());
         /*
          * Now freezes the XLink and ensures that it is really immutable.
          */
@@ -163,7 +163,7 @@ public final strictfp class XLinkTest ex
     public void testEquals() throws URISyntaxException {
         final XLink link = new XLink();
         link.setType(XLink.Type.AUTO);
-        link.setRole(new URI("org:geotoolkit:role"));
+        link.setRole(new URI("org:apache:sis:role"));
         link.setTitle(new SimpleInternationalString("Some title"));
         link.freeze();
 
@@ -175,7 +175,7 @@ public final strictfp class XLinkTest ex
         assertFalse(link.equals(other));
         assertFalse(link.hashCode() == other.hashCode());
 
-        other.setRole(new URI("org:geotoolkit:role"));
+        other.setRole(new URI("org:apache:sis:role"));
         assertFalse(link.equals(other));
         assertFalse(link.hashCode() == other.hashCode());
 

Modified: sis/trunk/src/main/docbook/book.entities
URL: http://svn.apache.org/viewvc/sis/trunk/src/main/docbook/book.entities?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/src/main/docbook/book.entities (original)
+++ sis/trunk/src/main/docbook/book.entities Thu Oct 18 12:27:10 2012
@@ -3,3 +3,11 @@
 <!ENTITY sis-release    "0.3-geoapi3.0-SNAPSHOT">
 <!ENTITY gml-version    "3.3">
 <!ENTITY geoapi-javadoc "http://www.geoapi.org/3.0/javadoc">
+<!ENTITY javase-docs    "http://docs.oracle.com/javase/6/docs">
+<!ENTITY xmlns-gco      "http://www.isotc211.org/2005/gco">
+<!ENTITY xmlns-gfc      "http://www.isotc211.org/2005/gfc">
+<!ENTITY xmlns-gmd      "http://www.isotc211.org/2005/gmd">
+<!ENTITY xmlns-gmi      "http://www.isotc211.org/2005/gmi">
+<!ENTITY xmlns-gmx      "http://www.isotc211.org/2005/gmx">
+<!ENTITY xmlns-gml      "http://www.opengis.net/gml">
+<!ENTITY xmlns-xlink    "http://www.w3.org/1999/xlink">

Modified: sis/trunk/src/main/docbook/book.xsl
URL: http://svn.apache.org/viewvc/sis/trunk/src/main/docbook/book.xsl?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/src/main/docbook/book.xsl (original)
+++ sis/trunk/src/main/docbook/book.xsl Thu Oct 18 12:27:10 2012
@@ -19,6 +19,10 @@
   <xsl:import href="urn:docbkx:stylesheet/docbook.xsl"/>
   <xsl:import href="urn:docbkx:stylesheet/highlight.xsl"/>
 
+  <!-- Parameters from http://docbook.sourceforge.net/release/xsl/current/doc/fo/  -->
+  <xsl:param name="section.autolabel" select="1"/>
+  <xsl:param name="section.label.includes.component.label" select="1"/>
+
   <!--
        Following is copied from "http://docbook.sourceforge.net/release/xsl/current/xhtml/component.xsl".
        Only the lines identified by a comment have been modified.  This file is used only for building
@@ -69,6 +73,11 @@
       <xsl:apply-templates mode="xslthl"/>
     </span>
   </xsl:template>
+  <xsl:template match="xslthl:comment" mode="xslthl">
+    <span class="hl-comment">
+      <xsl:apply-templates mode="xslthl"/>
+    </span>
+  </xsl:template>
   <xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl">
     <span class="hl-doccomment">
       <xsl:apply-templates mode="xslthl"/>
@@ -86,6 +95,7 @@
   <xsl:template match= "d:function[@role = 'OGC']"    mode="class.value"> <xsl:value-of select="'OGC'"   /> </xsl:template>
   <xsl:template match= "d:function[@role = 'GeoAPI']" mode="class.value"> <xsl:value-of select="'GeoAPI'"/> </xsl:template>
   <xsl:template match= "d:function[@role = 'SIS']"    mode="class.value"> <xsl:value-of select="'SIS'"   /> </xsl:template>
+  <xsl:template match=  "d:literal[@role = 'OGC']"    mode="class.value"> <xsl:value-of select="'OGC'"   /> </xsl:template>
   <xsl:template match=  "d:literal[@role = 'GeoAPI']" mode="class.value"> <xsl:value-of select="'GeoAPI'"/> </xsl:template>
   <xsl:template match=  "d:literal[@role = 'SIS']"    mode="class.value"> <xsl:value-of select="'SIS'"   /> </xsl:template>
 

Modified: sis/trunk/src/main/docbook/fr.xml
URL: http://svn.apache.org/viewvc/sis/trunk/src/main/docbook/fr.xml?rev=1399614&r1=1399613&r2=1399614&view=diff
==============================================================================
--- sis/trunk/src/main/docbook/fr.xml (original)
+++ sis/trunk/src/main/docbook/fr.xml Thu Oct 18 12:27:10 2012
@@ -30,5 +30,6 @@
   <xi:include href="fr/introduction.xml"/>
   <xi:include href="fr/standards.xml"/>
   <xi:include href="fr/geoapi.xml"/>
+  <xi:include href="fr/XML.xml"/>
 
 </book>