Hello everybody,

If I'm not wrong, the source code of the "standard" xerces version is
in the "trunk" branch, whereas the "schema-1.1" version is in the
"xml-schema-1.1-dev".

If so, in the xml-schema-1.1-dev branch we have some files that
diverged from trunk.

So, why do we have the "prepare-src-schema11" ant target?

Its role is to patch the source files to add schema 1.1 support, but
the source code is already modified to support schema 1.1 support.
So, what about simply integrating the patches defined in the
"prepare-src-schema11" target directly in the "xml-schema-1.1-dev"
branch?

Also, the build.xml file of the "xml-schema-1.1-dev" branch is meant
to be used to build Xerces with schema 1.1 support, so I think the
current target "jar" should be replaced by "jar-schema11" (the same
for "jars" / "jars-schema11).

Doing so, for example, the creation of distribution files would be
much easier: do you want to create the distribution files for the
"standard" version? Simply run "build pack-bin" in the trunk version.
Do you want to create the distribution files for the "schema-1.1"
version? Simply run "build pack-bin" in the xml-schema-1.1-dev version
(at the moment, this is not possible since "pack-bin" depends on
"jars" and not on "jars-schema11").

The attached simplify-schema11-build.patch files does all the above, that is:

1. update the .java files with the patches defined in the
"prepare-src-schema11" ant target

2. remove the "prepare-src-schema11" ant target

3. update the "jar-schema11" target so that it generates
"xercesImpl.jar" instead of "schema11-xercesImpl.jar" (that's the name
of the file included in the binary distribution files)

4. add to the "jars-schema11" target some missing dependencies
currently defined in the "jars" target (that is: icu4j.jar,
org.eclipse.wst.xml.xpath2.processor_1.2.1.jar, and
cupv10k-runtime.jar)

5. replace the content of the "compile" target with the content of the
"compile-schema11" target

6. replace the content of the "jar" target with the content of the
"jar-schema11" target

7. replace the content of the "jars" target with the content of the
"jars-schema11" target

8. remove the "jar-schema11" and "jars-schema11" targets.


Thoughts?

--
Ciao!
Michele
Index: build.xml
===================================================================
--- build.xml   (revision 1914161)
+++ build.xml   (working copy)
@@ -144,11 +144,9 @@
     <echo message=" available targets are:"/>
     <echo message=""/>
     
-    <echo message=" jar      --> generates the xercesImpl.jar file"/>
+    <echo message=" jar      --> generates the xercesImpl.jar file with XML 
Schema 1.1 support"/>
     <echo message=" sampjar  --> generates the xercesSamples.jar file"/>
-    <echo message=" jars --> generates xercesImpl &amp; xercesSamples jars"/>
-    <echo message=" jar-schema11 --> 'jar' + XML Schema 1.1 support"/>
-    <echo message=" jars-schema11 --> 'jars' + XML Schema 1.1 support"/>
+    <echo message=" jars --> generates xercesImpl &amp; xercesSamples jars 
with XML Schema 1.1 support"/>
     <echo message=" xjavac-jar --> generates the xjavac.jar file"/>
     <echo message=" docs     --> generates the HTML documentation"/>
     <echo message=" javadocs --> generates the API docs (needs Java 1.2 or 
higher)"/>
@@ -291,7 +289,7 @@
   </target>
 
   <!-- =================================================================== -->
-  <!-- Compiles the source directory                                       -->
+  <!-- Compiles the source directory with Schema 1.1 support               -->
   <!-- =================================================================== -->
   <target name="compile" depends="prepare-src">
     <copy todir="${build.dest}">
@@ -304,7 +302,7 @@
            destdir="${build.dest}"
            source="${javac.source}"
            target="${javac.target}"
-           
classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}:${tools.dir}/${jar.charnormalizer}:${tools.dir}/${jar.xpath2}:${tools.dir}/${jar.cup}"
+           
classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}:${tools.dir}/${jar.xpath2}"
            debug="${debug}"
            debuglevel="${debuglevel}"
            deprecation="${deprecation}"
@@ -314,13 +312,10 @@
            excludes="org/xml/sax/** 
                 javax/xml/**
                 org/w3c/dom/*
-                org/w3c/dom/bootstrap/**
                 org/w3c/dom/events/**
-                org/w3c/dom/ls/**
                 org/w3c/dom/html/**
                 org/w3c/dom/ranges/**
                 org/w3c/dom/traversal/**
-                org/w3c/dom/views/**
                 org/w3c/dom/xpath/**"
            />
   </target>
@@ -338,7 +333,7 @@
   </target>
 
   <!-- =================================================================== -->
-  <!-- Creates the implementation class package, including DOM Level 3     -->
+  <!-- Creates the implementation class package with Schema 1.1 support    -->
   <!-- =================================================================== -->
   <target name="jar" depends="compile">
     <!-- take care of manifest file -->
@@ -351,7 +346,14 @@
          basedir="${build.dest}"
          compress="true"
          includes="org/apache/**, META-INF/**
-                   org/w3c/dom/html/HTMLDOMImplementation.class"
+                   org/w3c/dom/html/HTMLDOMImplementation.class
+                   org/w3c/dom/ls/**
+                   org/w3c/dom/DOMError.class
+                   org/w3c/dom/DOMErrorHandler.class
+                   org/w3c/dom/DOMImplementationSource.class
+                   org/w3c/dom/DOMImplementationRegistry.class
+                   org/w3c/dom/DOMLocator.class
+                   org/w3c/dom/UserDataHandler.class"
          manifest="${build.dir}/manifest.xerces">
       <manifest>
         <attribute name="Ant-Version" value="${ant.version}"/>
@@ -973,7 +975,7 @@
   </target>
 
   <!-- =================================================================== -->
-  <!-- Builds xercesImpl, xml-apis and sample jar files                    -->
+  <!-- Builds xercesImpl, xml-apis and sample jars with Schema 1.1 support -->
   <!-- =================================================================== -->
   <target name="jars" depends="jar, sampjar">
     <!-- include the xml-commons APIs -->
@@ -1469,97 +1471,8 @@
     </java>
 
   </target>
-
-  <!-- =================================================================== -->
-  <!-- Prepares the source code with Schema 1.1 support                    -->
-  <!-- =================================================================== -->
-  <target name="prepare-src-schema11" depends="prepare-src">
-       <replace file="${build.src}/org/apache/xerces/impl/Constants.java"
-               token="SCHEMA_1_1_SUPPORT = false" value="SCHEMA_1_1_SUPPORT = 
true"/>
-       <replace file="${build.src}/org/apache/xerces/xs/XSConstants.java"
-           token="public static final short UNAVAILABLE_DT            = 45;"
-           value="public static final short UNAVAILABLE_DT            = 
45;&#xA;
-      &#xA;    public static final short YEARMONTHDURATION_DT      = 46;&#xA;
-      &#xA;    public static final short DAYTIMEDURATION_DT        = 47;&#xA;
-      &#xA;    public static final short PRECISIONDECIMAL_DT       = 48;&#xA;
-      &#xA;    public static final short ANYATOMICTYPE_DT          = 49;"/>
-  </target>
-
-  <!-- =================================================================== -->
-  <!-- Compiles the source directory with Schema 1.1 support               -->
-  <!-- =================================================================== -->
-  <target name="compile-schema11" depends="prepare-src-schema11">
-        <copy todir="${build.dest}">
-          <fileset dir="${build.src}"
-            includes="**/*.res, **/*.properties">
-          </fileset>
-        </copy>
-
-        <xjavac srcdir="${build.src}"
-               destdir="${build.dest}"
-               source="${javac.source}"
-               target="${javac.target}"
-                  
classpath="${build.dir}/classes:${tools.dir}/${jar.apis}:${tools.dir}/${jar.resolver}:${tools.dir}/${jar.serializer}:${tools.dir}/${jar.xpath2}"
-               debug="${debug}"
-               debuglevel="${debuglevel}"
-               deprecation="${deprecation}"
-               optimize="${optimize}"
-               includeAntRuntime="false"
-               includeJavaRuntime="false"
-               excludes="org/xml/sax/** 
-                    javax/xml/**
-                    org/w3c/dom/*
-                    org/w3c/dom/events/**
-                    org/w3c/dom/html/**
-                    org/w3c/dom/ranges/**
-                    org/w3c/dom/traversal/**
-                    org/w3c/dom/xpath/**"
-               />
-       </target>
   
   <!-- =================================================================== -->
-  <!-- Creates the implementation class package with Schema 1.1 support    -->
-  <!-- =================================================================== -->
-  <target name="jar-schema11" depends="compile-schema11">
-    <!-- take care of manifest file -->
-    <filter token="java.version" value="${java.version}"/>
-    <filter token="java.vendor" value="${java.vendor}"/>
-    <filter token="impl.name" value="${parser.Name} ${parser.Version}"/>
-    <filter token="impl.version" value="${parser.Version}"/>   
-    <copy todir="${build.dir}" file="${src.dir}/manifest.xerces" 
filtering="true"/>
-    <jar jarfile="${build.dir}/schema11-${jar.parser}"
-         basedir="${build.dest}"
-         compress="true"
-         includes="org/apache/**, META-INF/**
-                    org/w3c/dom/html/HTMLDOMImplementation.class
-                   org/w3c/dom/ls/**
-                   org/w3c/dom/DOMError.class
-                   org/w3c/dom/DOMErrorHandler.class
-                   org/w3c/dom/DOMImplementationSource.class
-                   org/w3c/dom/DOMImplementationRegistry.class
-                   org/w3c/dom/DOMLocator.class
-                   org/w3c/dom/UserDataHandler.class"
-         manifest="${build.dir}/manifest.xerces">
-      <manifest>
-        <attribute name="Ant-Version" value="${ant.version}"/>
-      </manifest>
-      <metainf dir="." includes="LICENSE,NOTICE"/>
-    </jar>
-  </target>    
-
-  <!-- =================================================================== -->
-  <!-- Builds xercesImpl, xml-apis and sample jars with Schema 1.1 support -->
-  <!-- =================================================================== -->
-  <target name="jars-schema11" depends="jar-schema11, sampjar">
-    <!-- include the xml-commons APIs -->
-    <copy file="${tools.dir}/${jar.apis}" tofile="${build.dir}/${jar.apis}"/>
-    <!-- include the xml-commons resolver -->
-    <copy file="${tools.dir}/${jar.resolver}" 
tofile="${build.dir}/${jar.resolver}"/>
-    <!-- include the Xalan Serializer -->
-    <copy file="${tools.dir}/${jar.serializer}" 
tofile="${build.dir}/${jar.serializer}"/>
-  </target>
-
-  <!-- =================================================================== -->
   <!-- Builds the xjavac jar file                                          -->
   <!-- =================================================================== -->
   <target name="xjavac-jar" depends="prepare">
Index: src/org/apache/xerces/impl/Constants.java
===================================================================
--- src/org/apache/xerces/impl/Constants.java   (revision 1914161)
+++ src/org/apache/xerces/impl/Constants.java   (working copy)
@@ -489,7 +489,7 @@
     public final static short XML_VERSION_1_1 = 2;
     
     // Constant to enable Schema 1.1 support
-    public final static boolean SCHEMA_1_1_SUPPORT = false;
+    public final static boolean SCHEMA_1_1_SUPPORT = true;
     public final static short SCHEMA_VERSION_1_0 = 1;
     public final static short SCHEMA_VERSION_1_0_EXTENDED = 2;
     public final static short SCHEMA_VERSION_1_1 = 4;
Index: src/org/apache/xerces/xs/XSConstants.java
===================================================================
--- src/org/apache/xerces/xs/XSConstants.java   (revision 1914161)
+++ src/org/apache/xerces/xs/XSConstants.java   (working copy)
@@ -342,5 +342,14 @@
      * The built-in type category is not available.
      */
     public static final short UNAVAILABLE_DT            = 45;
-    
+    /**
+     * yearMonthDuration
+     */
+    public static final short YEARMONTHDURATION_DT      = 46;
+    /**
+     * dayTimeDuration
+     */
+    public static final short DAYTIMEDURATION_DT        = 47;
+    public static final short PRECISIONDECIMAL_DT       = 48;
+    public static final short ANYATOMICTYPE_DT          = 49;
 }
---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to