You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2002/12/21 07:20:37 UTC

cvs commit: xml-cocoon2/src/documentation/xdocs/userdocs/concepts validation.xml

crossley    2002/12/20 22:20:37

  Modified:    .        build.xml changes.xml todo.xml
               src/documentation/xdocs/userdocs/concepts validation.xml
  Log:
  Integrated the validation targets into the build ("validate-config" and
  "validate-xdocs") also still available at the command-line. Validation
  happens automatically unless you switch it off.
  See document "XML Validation Facilities" userdocs/concepts/validation.xml
  
  Revision  Changes    Path
  1.294     +29 -18    xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.293
  retrieving revision 1.294
  diff -u -r1.293 -r1.294
  --- build.xml	19 Dec 2002 01:33:03 -0000	1.293
  +++ build.xml	21 Dec 2002 06:20:36 -0000	1.294
  @@ -257,6 +257,11 @@
       <filter token="database-user" value="${cocoon.samples.database.user}"/>
       <filter token="database-password" value="${cocoon.samples.database.password}"/>
   
  +    <!-- Use Jing for XML validation with RELAX NG -->
  +    <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
  +      <classpath refid="anttasks.classpath"/>
  +    </taskdef>
  +
       <!-- compile the ant tasks -->
       <mkdir dir="${tools.dir}/anttasks"/>
       <javac srcdir="${tools.dir}/src" 
  @@ -1251,7 +1256,7 @@
     <!-- The documentation system                                            -->
     <!-- =================================================================== -->
     <target name="docs"
  -          depends="package, prepare-docs, docs_check, docs_done"
  +          depends="package, prepare-docs, validate-xdocs, docs_check, docs_done"
             unless="docs.notrequired"
             description="Builds the documentation">
   
  @@ -1517,7 +1522,7 @@
     <!-- =================================================================== -->
     <!-- Prepare the war file                                                -->
     <!-- =================================================================== -->
  -  <target name="prepare-war" depends="prepare-webapp, prepare-webapp-javadocs, prepare-webapp-scratchpad, prepare-webapp-libs, prepare-scratchpad-libs, prepare-xsp" description="Prepares the war package">
  +  <target name="prepare-war" depends="prepare-webapp, validate-config, validate-xdocs, prepare-webapp-javadocs, prepare-webapp-scratchpad, prepare-webapp-libs, prepare-scratchpad-libs, prepare-xsp" description="Prepares the war package">
     </target>
   
     <!-- =================================================================== -->
  @@ -1593,7 +1598,7 @@
     <!-- =================================================================== -->
     <!-- Creates a local webapp directly useable as a servlet context        -->
     <!-- =================================================================== -->
  -  <target name="webapp-local" depends="prepare-webapp, prepare-webapp-scratchpad, copy-webapp-libs, copy-scratchpad-libs, compile-samples"
  +  <target name="webapp-local" depends="prepare-webapp, prepare-webapp-scratchpad, validate-config, validate-xdocs, copy-webapp-libs, copy-scratchpad-libs, compile-samples"
         description="Builds a local webapp directory usable as servlet context for quicker turn around">
       <copy todir="${build.war}/WEB-INF/classes">
         <fileset dir="${build.dest}"/>
  @@ -2294,25 +2299,17 @@
     <!-- =================================================================== -->
     <!-- Validation of core important configuration files using RELAX NG     -->
     <!-- =================================================================== -->
  -  <!-- Depends on some "prepare-*" targets, so that the sitemaps are generated
  +  <!-- Depends on "prepare-webapp" target, so that the sitemaps are generated
          and copied to the build.
  -  -->
  +       Uses the Jing anttask.
  +   -->
     <target name="validate-config"
             description="Validation of core configuration files using RELAX NG"
  -          depends="prepare-docs, prepare-webapp, prepare-webapp-scratchpad"
  +          depends="prepare-webapp"
             if="validate.config">
  -   <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
  -    <classpath refid="anttasks.classpath"/>
  -   </taskdef>
      <echo message="Conducting validation of core configuration files."/>
      <echo message="(You can turn validation off if you must, using ./properties.xml)"/>
   
  -   <!-- book.xml -->
  -   <echo message="Validating all book.xml instances ..."/>
  -   <jing rngfile="${webapp.dir}/WEB-INF/entities/book-v01.rng">
  -    <fileset dir="${build.context}" includes="**/book.xml"/>
  -   </jing>
  -
      <!-- cocoon.roles -->
      <echo message="Validating all cocoon.roles instances ..."/>
      <jing rngfile="${webapp.dir}/WEB-INF/entities/roles-v01.rng">
  @@ -2324,9 +2321,9 @@
      <jing rngfile="${webapp.dir}/WEB-INF/entities/xslt-20020523.rng">
   <!-- FIXME: Need catalog entity resolver, so excluding catalog tester xsl -->
   <!-- FIXME: Excluding the "hello world" SWF sitemap (minor issue) -->
  -    <fileset dir="./src" includes="**/*.xsl"
  +    <fileset dir="${src.dir}" includes="**/*.xsl"
         excludes="**/catalog/style.xsl, **/simple-page2swf.xsl"/>
  -    <fileset dir="./tools" includes="**/*.xsl"/>
  +    <fileset dir="${tools.dir}" includes="**/*.xsl"/>
      </jing>
   
      <!-- The Treeprocessor builtins -->
  @@ -2356,11 +2353,24 @@
             if="validate.xdocs">
      <echo message="Conducting validation of core XML documentation."/>
      <echo message="(You can turn validation off if you must, using ./properties.xml)"/>
  +
  +   <echo message="Validating all **/book.xml instances using RELAX NG ..."/>
  +   <jing rngfile="${webapp.dir}/WEB-INF/entities/book-v01.rng">
  +    <fileset dir="${build.context}" includes="**/book.xml"/>
  +   </jing>
  +
  +   <echo message="Validating all xdocs/**/*.xml instances using DTDs ..."/>
      <xmlvalidate failonerror="true" lenient="no" warn="yes">
  +    <!-- FIXME: we can use xmlcatalog with Ant-1.6 -->
       <fileset dir="${build.context}/xdocs" includes="**/*.xml"
           excludes="drafts/*.xml,dictionary.xml,catalog-test.xml,ctwig/sample/**/*.xml"
       />
      </xmlvalidate>
  +
  +   <echo message="Validating the documentation sitemap.xmap ..."/>
  +   <jing rngfile="${webapp.dir}/WEB-INF/entities/sitemap-v06.rng">
  +    <fileset dir="${build.context}" includes="sitemap.xmap"/>
  +   </jing>
     </target>
   
     <!-- =================================================================== -->
  @@ -2376,7 +2386,7 @@
     -->
     <target name="prepare-schematron"
        description="Generate Schematron schema from RNG grammar"
  -     depends="prepare-docs, prepare-webapp, prepare-webapp-scratchpad"
  +     depends="prepare-webapp, prepare-webapp-scratchpad"
        if="validate.config">
      <echo message="Generating Schematron schemas from RELAX NG grammars"/>
      <echo message="Currently doing: sitemap.rng only"/>
  @@ -2394,6 +2404,7 @@
     <target name="validate-schematron"
        description="Validate against Schematron schemas generated from RNG grammars"
        depends="prepare-schematron">
  +   <echo message="NOTE: this is an experimental build target."/>
      <echo message="Removing any old reports ..."/>
      <delete quiet="yes">
       <fileset dir="${build.dir}" includes="**/sitemap.report" />
  
  
  
  1.317     +7 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.316
  retrieving revision 1.317
  diff -u -r1.316 -r1.317
  --- changes.xml	19 Dec 2002 15:17:51 -0000	1.316
  +++ changes.xml	21 Dec 2002 06:20:36 -0000	1.317
  @@ -40,6 +40,12 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="DC" type="add">
  +   Integrated the validation targets into the build ("validate-config" and
  +   "validate-xdocs") also still available at the command-line. Validation
  +   happens automatically unless you switch it off. See document
  +   <link href="userdocs/concepts/validation.xml">XML Validation Facilities</link>.
  +  </action>
     <action dev="CH" type="fix" due-to-email="michael.enke@wincor-nixdorf.com"
      due-to="Michael Enke" fixes-bug="15064">
      Postgresql 7.3: LIMIT x,y no longer supported. Added new class for
  
  
  
  1.48      +1 -8      xml-cocoon2/todo.xml
  
  Index: todo.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/todo.xml,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- todo.xml	28 Nov 2002 06:30:13 -0000	1.47
  +++ todo.xml	21 Dec 2002 06:20:36 -0000	1.48
  @@ -31,13 +31,6 @@
    </devs>
   
    <actions priority="high">
  -  <action context="build" assigned-to="open">
  -   Integrate the new "validate-config" target into the build to conduct
  -   validation of core important configuration files. See email:
  -   <link href="http://marc.theaimsgroup.com/?l=xml-cocoon-dev&amp;m=103733768812046">[VOTE] build-time XML validation via RELAX NG</link>
  -   (which includes a link to the Proposal).
  -  </action> 
  -
     <action context="code" assigned-to="open">
      For 2.1: Rewrite the FilesystemStore. The current implementations relies on
      a correct implementation of the toString() method of the used
  
  
  
  1.2       +49 -4     xml-cocoon2/src/documentation/xdocs/userdocs/concepts/validation.xml
  
  Index: validation.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/userdocs/concepts/validation.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- validation.xml	2 Dec 2002 01:36:47 -0000	1.1
  +++ validation.xml	21 Dec 2002 06:20:37 -0000	1.2
  @@ -5,7 +5,7 @@
    <header>
     <title>XML Validation Facilities</title>
     <subtitle>Conducting build-time and run-time validation</subtitle>
  -  <version>0.1</version> 
  +  <version>0.2</version> 
     <type>Technical document</type> 
     <authors>
      <person name="David Crossley" email="crossley@indexgeo.com.au"/>
  @@ -35,12 +35,19 @@
   (e.g. sitemap.rng) are minimal tests only and utilises Schematron Basic.
   Everything is experimental.
     </p>
  +
  +  <p>
  +With that said, the validation system does work and is waiting for your help
  +to extend it.
  +  </p>
    </s1>
   
    <s1 title="Operation">
      <p>
  -    For 2.1-dev there are currently 2002-12-02 three standalone validation
  -    targets.
  +    There are three validation targets in build.xml (see some internal notes).
  +    If you do not want validation to happen automatically during the build
  +    (for some strange reason) then you can switch it off in
  +    <code>./properties.xml</code>
      </p>
      <p>
       There are also validation facilities in Cocoon XMLForm.
  @@ -50,11 +57,20 @@
   
     <s2 title="Build target validate-config">
      <p>
  -    2.1-dev and 2.0.4
  +    2.1-dev and 2.0.5
      </p>
      <p>
       <code>./build.sh validate-config</code>
      </p>
  +   <p>
  +    Called automatically during the build (only 2.1) and can also be called
  +    from the command-line.
  +   </p>
  +   <p>
  +    Validation of some core configuration files using RELAX NG. Currently doing:
  +    cocoon.roles, *.xsl, **/sitemap.xmap,
  +    and treeprocessor-builtins.xml (using DTD).
  +   </p>
     </s2>
   
     <s2 title="Build target validate-schematron">
  @@ -64,6 +80,13 @@
      <p>
       <code>./build.sh validate-schematron</code>
      </p>
  +   <p>
  +    Can only be called from the command-line.
  +   </p>
  +   <p>
  +    Validation of all sitemap.xmap using Schematron rules embedded in
  +    RELAX NG grammars. (Very experimental.)
  +   </p>
     </s2>
   
     <s2 title="Build target validate-xdocs">
  @@ -73,6 +96,14 @@
      <p>
       <code>./build.sh validate-xdocs</code>
      </p>
  +   <p>
  +    Called automatically during the build, and can also be called from the
  +    command-line.
  +   </p>
  +   <p>
  +    Validation of all core documentation/xdocs Currently doing:
  +    book.xml (using RELAX NG), *.xml (using DTD).
  +   </p>
     </s2>
   
     <s2 title="XMLForm Validation">
  @@ -83,6 +114,20 @@
   Basic overview: <link href="xmlform.html">XMLForm Handling</link>
      </p>
     </s2>
  + </s1>
  +
  + <s1 title="To Do">
  +<ul>
  +<li>Is the validate-config stuff properly integrated in the build.xml ?
  +Is it being called from all of the appropriate places? e.g. should it also be
  +called from the default target "all"?</li>
  +<li>Integrate this build-time validation into 2.0.5 (currently standalone
  +targets).</li>
  +<li>All of the RELAX NG grammars are basic and need enhancement.</li>
  +<li>The validate-schematron targets are particularly experimental.</li>
  +<li>After this build-time validation is settled, then perhaps we can also do
  +run-time validation when sitemap changes are effected.</li>
  +</ul>
    </s1>
   
    <s1 title="Stuff">
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org