incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1172430 [1/3] - in /incubator/odf/trunk/validator: ./ misc/ nbproject/ src/ src/odfvalidator/ xslt/
Date Mon, 19 Sep 2011 05:30:40 GMT
Author: devinhan
Date: Mon Sep 19 05:30:38 2011
New Revision: 1172430

URL: http://svn.apache.org/viewvc?rev=1172430&view=rev
Log:
changeset:   0:6586de878157
user:        Lars Behrmann <Lars.Behrmann@Sun.COM>
date:        Sat Nov 01 17:08:36 2008 +0100
Initial Check In

Added:
    incubator/odf/trunk/validator/build.xml
    incubator/odf/trunk/validator/manifest.mf
    incubator/odf/trunk/validator/misc/
    incubator/odf/trunk/validator/misc/config_template.properties
    incubator/odf/trunk/validator/misc/filter.rng
    incubator/odf/trunk/validator/nbproject/
    incubator/odf/trunk/validator/nbproject/build-impl.xml
    incubator/odf/trunk/validator/nbproject/genfiles.properties
    incubator/odf/trunk/validator/nbproject/project.properties
    incubator/odf/trunk/validator/nbproject/project.xml
    incubator/odf/trunk/validator/schema.properties
    incubator/odf/trunk/validator/schema.user.properties
    incubator/odf/trunk/validator/src/
    incubator/odf/trunk/validator/src/odfvalidator/
    incubator/odf/trunk/validator/src/odfvalidator/AlienFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/Configuration.java
    incubator/odf/trunk/validator/src/odfvalidator/ContentFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/DSigFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/InternalResources.java
    incubator/odf/trunk/validator/src/odfvalidator/Logger.java
    incubator/odf/trunk/validator/src/odfvalidator/Main.java
    incubator/odf/trunk/validator/src/odfvalidator/ManifestEntry.java
    incubator/odf/trunk/validator/src/odfvalidator/ManifestFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/MathML101Filter.java
    incubator/odf/trunk/validator/src/odfvalidator/MathML20Filter.java
    incubator/odf/trunk/validator/src/odfvalidator/MetaFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/MetaInformation.java
    incubator/odf/trunk/validator/src/odfvalidator/MetaInformationListener.java
    incubator/odf/trunk/validator/src/odfvalidator/NamespaceFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFFileFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFFileValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFMediaTypes.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFPackageValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFRootPackageValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFStreamValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFSubPackageValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFValidator.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFValidatorException.java
    incubator/odf/trunk/validator/src/odfvalidator/ODFValidatorProvider.java
    incubator/odf/trunk/validator/src/odfvalidator/OdfPackageExt.java
    incubator/odf/trunk/validator/src/odfvalidator/SAXParseExceptionFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/SAXVersionException.java
    incubator/odf/trunk/validator/src/odfvalidator/SchemaErrorHandler.java
    incubator/odf/trunk/validator/src/odfvalidator/SchemaFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/SchemaResourceResolver.java
    incubator/odf/trunk/validator/src/odfvalidator/ValidationMessageCollectorErrorFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/ValidationOOoTaskIdErrorFilter.java
    incubator/odf/trunk/validator/src/odfvalidator/VersionHandler.java
    incubator/odf/trunk/validator/xslt/
    incubator/odf/trunk/validator/xslt/create_config.xsl
    incubator/odf/trunk/validator/xslt/fix_rng_for_msv.xsl

Added: incubator/odf/trunk/validator/build.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/build.xml?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/build.xml (added)
+++ incubator/odf/trunk/validator/build.xml Mon Sep 19 05:30:38 2011
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+
+  Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+
+  Use is subject to license terms.
+
+  Licensed 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. You can also
+  obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+
+  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.
+
+-->
+
+<project name="ODFValidator" default="default" basedir=".">
+    <description>Builds, tests, and runs the project ODFValidator.</description>
+    <import file="nbproject/build-impl.xml"/>
+
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+    -pre-init:                 called before initialization of project properties
+    -post-init:                called after initialization of project properties
+    -pre-compile:              called before javac compilation
+    -post-compile:             called after javac compilation
+    -pre-compile-single:       called before javac compilation of single file
+    -post-compile-single:      called after javac compilation of single file
+    -pre-compile-test:         called before javac compilation of JUnit tests
+    -post-compile-test:        called after javac compilation of JUnit tests
+    -pre-compile-test-single:  called before javac compilation of single JUnit test
+    -post-compile-test-single: called after javac compilation of single JUunit test
+    -pre-jar:                  called before JAR building
+    -post-jar:                 called after JAR building
+    -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+    <target name="-post-compile">
+    <obfuscate>
+    <fileset dir="${build.classes.dir}"/>
+    </obfuscate>
+    </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+    -init-macrodef-javac:     defines macro for javac compilation
+    -init-macrodef-junit:     defines macro for junit execution
+    -init-macrodef-debug:     defines macro for class debugging
+    -init-macrodef-java:      defines macro for class execution
+    -do-jar-with-manifest:    JAR building (if you are using a manifest)
+    -do-jar-without-manifest: JAR building (if you are not using a manifest)
+    run:                      execution of project 
+    -javadoc-build:           Javadoc generation
+    test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+    <target name="run" depends="ODFValidator-impl.jar">
+    <exec dir="bin" executable="launcher.exe">
+    <arg file="${dist.jar}"/>
+    </exec>
+    </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+
+    <property file="schema.user.properties"/>
+    <property file="schema.properties"/>
+
+    <property name="opendocument.v10.schema" value="OpenDocument-schema-v1.0${opendocument.v10.schema.state}.rng"/>
+    <property name="opendocument.v10.schema.strict" value="OpenDocument-strict-schema-v1.0${opendocument.v10.schema.state}.rng"/>
+    <property name="opendocument.v10.schema.manifest" value="OpenDocument-manifest-schema-v1.0${opendocument.v10.schema.state}.rng"/>
+    <property name="opendocument.v11.schema" value="OpenDocument-schema-v1.1${opendocument.v11.schema.state}.rng"/>
+    <property name="opendocument.v11.schema.strict" value="OpenDocument-strict-schema-v1.1${opendocument.v11.schema.state}.rng"/>
+    <property name="opendocument.v11.schema.manifest" value="OpenDocument-manifest-schema-v1.1${opendocument.v11.schema.state}.rng"/>
+    <property name="opendocument.v12.schema" value="OpenDocument-schema-v1.2${opendocument.v12.schema.state}.rng"/>
+    <property name="opendocument.v12.schema.strict" value="OpenDocument-strict-schema-v1.2${opendocument.v12.schema.state}.rng"/>
+    <property name="opendocument.v12.schema.manifest" value="OpenDocument-manifest-schema-v1.2${opendocument.v12.schema.state}.rng"/>
+    <property name="opendocument.v12.schema.dsig" value="OpenDocument-dsig-schema-v1.2${opendocument.v12.schema.state}.rng"/>
+
+    <target name="-pre-jar" depends="init,-copy-v10-schema,-copy-v11-schema,-copy-v12-schema,-copy-mathml-schema,-copy-mathml2-schema,-create-v10-validator-config,-create-v11-validator-config,-create-v12-validator-config"/>
+
+       
+    <target name="-copy-v10-schema" depends="init">
+        <xslt style="xslt/fix_rng_for_msv.xsl" 
+                    in="${opendocument.v10.schema.dir}/${opendocument.v10.schema}" 
+                    out="${build.classes.dir}/schema/odf10/${opendocument.v10.schema}"/>  
+        <copy todir="${build.classes.dir}/schema/odf10">
+            <fileset dir="${opendocument.v10.schema.dir}" includes="*.rng" excludes="${opendocument.v10.schema}"/>
+        </copy>
+    </target>
+
+    <target name="-copy-v11-schema" depends="init">
+        <xslt style="xslt/fix_rng_for_msv.xsl" 
+                    in="${opendocument.v11.schema.dir}/${opendocument.v11.schema}" 
+                    out="${build.classes.dir}/schema/odf11/${opendocument.v11.schema}"/>  
+        <copy todir="${build.classes.dir}/schema/odf11">
+            <fileset dir="${opendocument.v11.schema.dir}" includes="*.rng" excludes="${opendocument.v11.schema}"/>
+        </copy>
+    </target>
+
+    <target name="-copy-v12-schema" depends="init,-get-v12-schemas">
+        <xslt style="xslt/fix_rng_for_msv.xsl" 
+                    in="${v12.schema.dir}/${opendocument.v12.schema}" 
+                    out="${build.classes.dir}/schema/odf12/${opendocument.v12.schema}"/>  
+        <copy todir="${build.classes.dir}/schema/odf12">
+            <fileset dir="${v12.schema.dir}" includes="*.rng" excludes="${opendocument.v12.schema}"/>
+        </copy>
+    </target>
+
+    <target name="-get-v12-schemas" depends="init">
+        <property name="v12.schema.dir" value="${opendocument.v12.schema.dir}"/>
+    </target>
+
+    <target name="-copy-mathml-schema" depends="init">
+        <copy todir="${build.classes.dir}/schema/mathml">
+            <fileset dir="${mathml.schema.dir}" includes="*.dtd *.ent"/>
+        </copy>
+    </target>
+
+    <target name="-copy-mathml2-schema" depends="init">
+        <copy todir="${build.classes.dir}/schema/mathml2">
+            <fileset dir="${mathml2.schema.dir}" includes="*.xsd **/*.xsd"/>
+        </copy>
+    </target>
+
+    <target name="-create-v10-validator-config" depends="init">
+        <antcall target="-create-validator-config">
+            <param name="config.file" value="${build.classes.dir}/config/v10.properties"/>
+            <param name="schema" value="schema/odf10/${opendocument.v10.schema}"/>
+            <param name="strict-schema" value="schema/odf10/${opendocument.v10.schema.strict}"/>
+            <param name="manifest-schema" value="schema/odf10/${opendocument.v10.schema.manifest}"/>
+            <param name="mathml-schema" value="schema/mathml/math.dtd"/>
+            <param name="mathml2-schema" value="schema/mathml2/mathml2.xsd"/>
+        </antcall>
+    </target>
+
+    <target name="-create-v11-validator-config" depends="init">
+        <antcall target="-create-validator-config">
+            <param name="config.file" value="${build.classes.dir}/config/v11.properties"/>
+            <param name="schema" value="schema/odf11/${opendocument.v11.schema}"/>
+            <param name="strict-schema" value="schema/odf11/${opendocument.v11.schema.strict}"/>
+            <param name="manifest-schema" value="schema/odf11/${opendocument.v11.schema.manifest}"/>
+            <param name="mathml-schema" value="schema/mathml/math.dtd"/>
+            <param name="mathml2-schema" value="schema/mathml2/mathml2.xsd"/>
+        </antcall>
+    </target>
+
+    <target name="-create-v12-validator-config" depends="init">
+        <antcall target="-create-validator-config">
+            <param name="config.file" value="${build.classes.dir}/config/v12.properties"/>
+            <param name="schema" value="schema/odf12/${opendocument.v12.schema}"/>
+            <param name="strict-schema" value="schema/odf12/${opendocument.v12.schema.strict}"/>
+            <param name="manifest-schema" value="schema/odf12/${opendocument.v12.schema.manifest}"/>
+            <param name="dsig-schema" value="schema/odf12/${opendocument.v12.schema.dsig}"/>
+            <param name="mathml-schema" value="schema/mathml/math.dtd"/>
+            <param name="mathml2-schema" value="schema/mathml2/mathml2.xsd"/>
+        </antcall>
+    </target>
+
+    <target name="-create-validator-config" depends="init">
+        <condition property="dsig-schema-param" value="${dsig-schema}" else="">
+            <isset property="dsig-schema" />
+        </condition>
+        <condition property="path-param" value="${path}" else="">
+            <isset property="path" />
+        </condition>
+        <condition property="filter-param" value="${filter}" else="">
+            <isset property="filter" />
+        </condition>
+        <xslt style="xslt/create_config.xsl" 
+                    in="misc/config_template.properties" 
+                    out="${config.file}">
+            <param name="schema" expression="${schema}"/>
+            <param name="strict-schema" expression="${strict-schema}"/>
+            <param name="manifest-schema" expression="${manifest-schema}"/>
+            <param name="mathml-schema" expression="${mathml-schema}"/>
+            <param name="dsig-schema" expression="${dsig-schema-param}"/>
+            <param name="mathml-schema" expression="${mathml-schema}"/>
+            <param name="mathml2-schema" expression="${mathml2-schema}"/>
+            <param name="path" expression="${path-param}"/>
+            <param name="filter" expression="${filter-param}"/>
+        </xslt >
+    </target>
+
+    
+    <target name="test" depends="jar" description="Test ODFValidator">
+        <condition property="mathml.dtd.option" value="" else="-d">
+            <istrue value="${use.mathml2.xsd}"/>
+        </condition>
+        <java jar="${dist.jar}" fork="true">
+            <arg value="-v"/>
+            <arg value="-s"/>
+            <arg value="${mathml.dtd.option}"/>
+            <arg value="${testdocs.dir}"/>
+        </java>
+    </target>
+    
+    
+</project>
+
+
+

Added: incubator/odf/trunk/validator/manifest.mf
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/manifest.mf?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/manifest.mf (added)
+++ incubator/odf/trunk/validator/manifest.mf Mon Sep 19 05:30:38 2011
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+

Added: incubator/odf/trunk/validator/misc/config_template.properties
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/misc/config_template.properties?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/misc/config_template.properties (added)
+++ incubator/odf/trunk/validator/misc/config_template.properties Mon Sep 19 05:30:38 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<!--
+
+  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+
+  Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+
+  Use is subject to license terms.
+
+  Licensed 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. You can also
+  obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+
+  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.
+
+-->
+<properties>
+<entry key="manifest-schema"/>
+<entry key="strict-schema"/>
+<entry key="schema"/>
+<entry key="mathml-schema"/>
+<entry key="mathml2-schema"/>
+<entry key="dsig-schema"/>
+<entry key="path1"/>
+<entry key="filter"/>
+</properties>
+

Added: incubator/odf/trunk/validator/misc/filter.rng
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/misc/filter.rng?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/misc/filter.rng (added)
+++ incubator/odf/trunk/validator/misc/filter.rng Mon Sep 19 05:30:38 2011
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+
+  Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+
+  Use is subject to license terms.
+
+  Licensed 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. You can also
+  obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+
+  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.
+
+-->
+
+<grammar
+    xmlns="http://relaxng.org/ns/structure/1.0"
+    xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+
+    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+    
+    <start>
+        <ref name="filter"/>
+    </start>
+
+    <define name="filter">
+        <element name="filter">
+            <ref name="filter-attlist"/>
+            <oneOrMore>
+                <ref name="filter-entry"/>
+            </oneOrMore>
+        </element>
+    </define>
+    
+    <define name="filter-attlist" combine="interleave">
+        <empty/>
+    </define>
+    
+    <define name="filter-entry">
+        <element name="filter-entry">
+            <ref name="filter-entry-attlist"/>
+            <text/>
+        </element>
+    </define>
+
+    <define name="filter-entry-attlist" combine="interleave">
+        <attribute name="task-id">
+            <data type="string">
+                 <param name="pattern">[a-z]?[0-9]+"</param>
+            </data>
+        </attribute>
+    </define>
+
+    <define name="filter-entry-attlist" combine="interleave">
+        <optional>
+            <attribute name="resolved-in">
+                <data type="integer"/>
+            </attribute>
+        </optional>
+    </define>
+    
+</grammar>
\ No newline at end of file

Added: incubator/odf/trunk/validator/nbproject/build-impl.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/nbproject/build-impl.xml?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/nbproject/build-impl.xml (added)
+++ incubator/odf/trunk/validator/nbproject/build-impl.xml Mon Sep 19 05:30:38 2011
@@ -0,0 +1,627 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="odfvalidator-impl">
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="libs.CopyLibs.classpath"/>
+            </and>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
+            <and>
+                <isset property="jaxws.endorsed.dir"/>
+                <available file="nbproject/jaxws-build.xml"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-javac">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="" name="sourcepath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="," property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <delete>
+                    <files includes="${javac.includes.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target depends="init" name="deps-jar" unless="no.deps"/>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <j2seproject3:depend/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <pathconvert property="run.classpath.without.build.classes.dir">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to=""/>
+        </pathconvert>
+        <pathconvert pathsep=" " property="jar.classpath">
+            <path path="${run.classpath.without.build.classes.dir}"/>
+            <chainedmapper>
+                <flattenmapper/>
+                <globmapper from="*" to="lib/*"/>
+            </chainedmapper>
+        </pathconvert>
+        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+            <fileset dir="${build.classes.dir}"/>
+            <manifest>
+                <attribute name="Main-Class" value="${main.class}"/>
+                <attribute name="Class-Path" value="${jar.classpath}"/>
+            </manifest>
+        </copylibs>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo>java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,-do-not-recompile,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+        </javadoc>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                JUNIT COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                JUNIT EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:junit testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <!--
+                =======================
+                JUNIT DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+        <delete file="${test.report.file}"/>
+        <mkdir dir="${build.test.results.dir}"/>
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+            <customize>
+                <syspropertyset>
+                    <propertyref prefix="test-sys-prop."/>
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                </syspropertyset>
+                <arg value="${test.class}"/>
+                <arg value="showoutput=true"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target depends="init" name="deps-clean" unless="no.deps"/>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+</project>

Added: incubator/odf/trunk/validator/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/nbproject/genfiles.properties?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/nbproject/genfiles.properties (added)
+++ incubator/odf/trunk/validator/nbproject/genfiles.properties Mon Sep 19 05:30:38 2011
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=cec7d023
+build.xml.script.CRC32=729450ca
+build.xml.stylesheet.CRC32=be360661
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=cec7d023
+nbproject/build-impl.xml.script.CRC32=98e5e355
+nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08

Added: incubator/odf/trunk/validator/nbproject/project.properties
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/nbproject/project.properties?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/nbproject/project.properties (added)
+++ incubator/odf/trunk/validator/nbproject/project.properties Mon Sep 19 05:30:38 2011
@@ -0,0 +1,77 @@
+application.desc=This tools validates ODF documents.
+application.homepage=http://odftoolkit.openoffice.org/
+application.title=ODF Validator
+application.vendor=Sun Microsystems, Inc.
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/odfvalidator.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+file.reference.isorelax-jaxp-bridge-1.0.jar=lib/isorelax-jaxp-bridge-1.0.jar
+file.reference.isorelax.jar=lib/isorelax.jar
+file.reference.msv.jar=lib/msv.jar
+file.reference.odfdom.jar=lib/odfdom.jar
+file.reference.relaxngDatatype.jar=lib/relaxngDatatype.jar
+file.reference.xercesImpl.jar=lib/xercesImpl.jar
+file.reference.xsdlib.jar=lib/xsdlib.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+    ${file.reference.isorelax-jaxp-bridge-1.0.jar}:\
+    ${file.reference.isorelax.jar}:\
+    ${file.reference.msv.jar}:\
+    ${file.reference.odfdom.jar}:\
+    ${file.reference.relaxngDatatype.jar}:\
+    ${file.reference.xercesImpl.jar}:\
+    ${file.reference.xsdlib.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=-Xlint:unchchecked
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit.classpath}:\
+    ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=odfvalidator.Main
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test

Added: incubator/odf/trunk/validator/nbproject/project.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/nbproject/project.xml?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/nbproject/project.xml (added)
+++ incubator/odf/trunk/validator/nbproject/project.xml Mon Sep 19 05:30:38 2011
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>odfvalidator</name>
+            <minimum-ant-version>1.6.5</minimum-ant-version>
+            <source-roots>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+    </configuration>
+</project>

Added: incubator/odf/trunk/validator/schema.properties
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/schema.properties?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/schema.properties (added)
+++ incubator/odf/trunk/validator/schema.properties Mon Sep 19 05:30:38 2011
@@ -0,0 +1,8 @@
+# State of the OpenDocument v1.0 specification
+opendocument.v10.schema.state=-os
+
+# State of the OpenDocument v1.1 specification
+opendocument.v11.schema.state=
+
+# State of the OpenDocument v1.2 specification
+opendocument.v12.schema.state=-draft7

Added: incubator/odf/trunk/validator/schema.user.properties
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/schema.user.properties?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/schema.user.properties (added)
+++ incubator/odf/trunk/validator/schema.user.properties Mon Sep 19 05:30:38 2011
@@ -0,0 +1,23 @@
+# Directory where the OpenDocument v1.0 schemas are stored
+opendocument.v10.schema.dir=
+
+# Directory where the OpenDocument v1.1 schemas are stored
+opendocument.v11.schema.dir=
+
+# Directory where the OpenDocument v1.1 schemas are stored
+opendocument.v12.schema.dir=
+
+# Directory where the MathML 1.01 DTD is stored
+mathml.schema.dir=
+
+# Directory where the MathML 2.0 schema is stored
+mathml2.schema.dir=
+
+# Use MathML2 XSD schema (default is to use the MathML 1.01 DTD)
+use.mathml2.xsd=true
+
+# Directory of test documents
+testdocs.dir=
+
+# Warning level for validation (-v or -w)
+validator.warning.level=-v
\ No newline at end of file

Added: incubator/odf/trunk/validator/src/odfvalidator/AlienFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/AlienFilter.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/AlienFilter.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/AlienFilter.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,137 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+import java.util.HashSet;
+import java.util.Vector;
+import org.openoffice.odf.dom.OdfNamespace;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+class AlienFilter extends XMLFilterImpl {
+
+    private static final String OFFICE_NAMESPACE_URI = OdfNamespace.OFFICE.toString();
+    
+    private static final String PROCESS_CONTENT = "process-content";
+    private static final String TRUE_STRING = "true";
+    
+    private static HashSet<String> m_aODFNamespaceSet = null;
+    private Vector<Boolean> m_aAlienElements = null;
+
+    private Logger m_aLogger;
+
+    /** Creates a new instance of NamespaceFilter */
+    AlienFilter( Logger aLogger ) {
+        m_aLogger = aLogger;
+        m_aAlienElements = new Vector<Boolean>();
+        
+        m_aODFNamespaceSet = new HashSet<String>();
+        m_aODFNamespaceSet.add( OdfNamespace.OFFICE.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.STYLE.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.TEXT.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.TABLE.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.DRAW.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.FO.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.DC.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.META.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.NUMBER.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.SVG.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.CHART.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.DR3D.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.FORM.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.PRESENTATION.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.SMIL.toString() );
+        m_aODFNamespaceSet.add( "urn:oasis:names:tc:opendocument:xmlns:config:1.0" );
+        m_aODFNamespaceSet.add( OdfNamespace.SCRIPT.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.XLINK.toString() );
+        m_aODFNamespaceSet.add( OdfNamespace.XFORMS.toString() );
+    }
+
+
+
+    @Override
+    public void endElement(String aUri, String aLocalName, String aQName) throws SAXException {
+        if( isAlienNamespace(aUri) )
+        {
+            m_aAlienElements.removeElementAt( m_aAlienElements.size()-1 );
+        }
+        else
+        {
+            boolean bProcessContent = m_aAlienElements.isEmpty() ? true : m_aAlienElements.lastElement();
+            if( bProcessContent )
+                super.endElement(aUri,aLocalName,aQName);
+        }
+    }
+
+
+    @Override
+    public void startElement(String aUri, String aLocalName, String aQName, Attributes aAtts) throws SAXException {
+        Boolean bProcessContent = m_aAlienElements.isEmpty() ? true : m_aAlienElements.lastElement();
+        
+        if( isAlienNamespace(aUri) )
+        {
+            if( bProcessContent )
+            {
+                String aProcessContentValue = aAtts.getValue( OFFICE_NAMESPACE_URI, PROCESS_CONTENT );
+                bProcessContent = aProcessContentValue == null || aProcessContentValue.equals(TRUE_STRING);
+            }
+            m_aAlienElements.addElement( bProcessContent );
+            m_aLogger.logInfo( String.format("element <%s> ignored, content is %s.",aQName,bProcessContent?"processed":"not processed"), false);            
+        }
+        else if( bProcessContent )
+        {
+            Attributes aOldAtts = aAtts;
+            AttributesImpl aNewAtts = null;
+            int i = aOldAtts.getLength();
+            while( i>0 ) {
+                --i;
+                if ( isAlienNamespace( aOldAtts.getURI(i) ) ) {
+                    if (aNewAtts == null) {
+                        aNewAtts = new AttributesImpl(aOldAtts);
+                        aAtts = aNewAtts;
+                    }
+                    m_aLogger.logInfo( String.format("attribute '%s' of element <%s> ignored.",aAtts.getQName(i),aQName), false);            
+                    aNewAtts.removeAttribute(i);
+                }
+            }
+            super.startElement(aUri, aLocalName, aQName, aAtts);
+        }
+    }
+    
+    
+
+    private boolean isAlienNamespace( String aUri )
+    {
+        return !m_aODFNamespaceSet.contains(aUri);
+    }
+
+    public void characters(char[] aChars, int nStart, int nLength) throws SAXException {
+        boolean bProcessContent = m_aAlienElements.isEmpty() ? true : m_aAlienElements.lastElement();
+        if( bProcessContent )
+            super.characters(aChars, nStart, nLength);
+    }
+    
+    
+}

Added: incubator/odf/trunk/validator/src/odfvalidator/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/Configuration.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/Configuration.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/Configuration.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,93 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.TreeSet;
+import java.util.Vector;
+
+public class Configuration extends Properties {
+
+    
+    public static final String SCHEMA = "schema";
+    public static final String STRICT_SCHEMA = "strict-schema";
+    public static final String MANIFEST_SCHEMA = "manifest-schema";
+    public static final String MATHML_SCHEMA = "mathml-schema";
+    public static final String MATHML2_SCHEMA = "mathml2-schema";
+    public static final String DSIG_SCHEMA = "dsig-schema";
+    public static final String PATH = "path";
+    public static final String EXCLUDE = "exclude";
+    public static final String RECURSIVE = "recursive";
+    public static final String FILTER = "filter";
+
+    public static final String VALIDATOR_URL = "validator-url";
+    public static final String PROXY_HOST="proxy-host";
+    public static final String PROXY_PORT="proxy-port";
+
+    /** Creates a new instance of AppProperties */
+    public Configuration()
+    {
+    }
+    
+    public Configuration( File aConfigFile ) throws FileNotFoundException, IOException
+    {
+        FileInputStream aInStream = new FileInputStream( aConfigFile );
+        loadFromXML( aInStream );
+        aInStream.close();
+    }
+    
+
+    public void store( File aConfigFile ) throws FileNotFoundException, IOException 
+    {
+        FileOutputStream aOutStream = new FileOutputStream( aConfigFile );
+        storeToXML( aOutStream, null );
+        aOutStream.close();
+    }
+    
+    public List<String> getListPropety( String aPropNamePrefix )
+    {
+        TreeSet<String> aSortedPropNames = new TreeSet<String>();
+        Enumeration aPropNames = propertyNames();
+        while( aPropNames.hasMoreElements() )
+        {
+            String aPropName = (String)aPropNames.nextElement();
+            if( aPropName.startsWith(aPropNamePrefix))
+                aSortedPropNames.add(aPropName);
+        }
+        
+        List<String> aValues = new Vector<String>(aSortedPropNames.size());
+        Iterator<String> aIter = aSortedPropNames.iterator();
+        while( aIter.hasNext() )
+            aValues.add(getProperty( aIter.next() ) );
+        
+        return aValues;
+    }
+}

Added: incubator/odf/trunk/validator/src/odfvalidator/ContentFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/ContentFilter.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/ContentFilter.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/ContentFilter.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,103 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.openoffice.odf.dom.OdfNamespace;
+
+class ContentFilter extends NamespaceFilter {
+
+    private static final String CD2_SVG_NAMESPACE_URI = "http://www.w3.org/2000/svg";
+    private static final String CD2_XSL_NAMESPACE_URI = "http://www.w3.org/1999/XSL/Format";
+    private static final String CD2_SMIL_NAMESPACE_URI = "http://www.w3.org/2001/SMIL20/";
+    private static final String BASE_OFFICE_NAMESPACE_URI = "http://openoffice.org/2004/office";
+    private static final String BASE_DB_NAMESPACE_URI = "http://openoffice.org/2004/database";
+    private static final String SVG_NAMESPACE_URI = OdfNamespace.SVG.toString();
+    private static final String XSL_NAMESPACE_URI = OdfNamespace.FO.toString();
+    private static final String SMIL_NAMESPACE_URI = OdfNamespace.SMIL.toString();
+    private static final String DRAW_NAMESPACE_URI = OdfNamespace.DRAW.toString();
+    private static final String OFFICE_NAMESPACE_URI = OdfNamespace.OFFICE.toString();;
+    private static final String DB_NAMESPACE_URI = "urn:oasis:names:tc:opendocument:xmlns:database:1.0";
+    private static final String BASE_OFFICE_NAMESPACE_PREFIX = "office";
+    private static final String POLYGON = "polygon";
+    private static final String CONTOUR_POLYGON = "contour-polygon";
+    private static final String POLYLINE = "polyline";
+    private static final String POINTS = "points";
+    private static final int MAX_POINTS_LEN = 2048;
+        
+    private Logger m_aLogger;
+    
+    /** Creates a new instance of KnownIssueFilter */
+    ContentFilter( Logger aLogger ) {
+        m_aLogger = aLogger;
+    }
+
+    String adaptNamespaceUri( String aUri, String aPrefix)
+    {
+        String aNewUri = null;
+        if( aUri.equals(CD2_SVG_NAMESPACE_URI) )
+            aNewUri = SVG_NAMESPACE_URI;
+        else if( aUri.equals(CD2_XSL_NAMESPACE_URI) )
+             aNewUri = XSL_NAMESPACE_URI;
+        else if( aUri.equals(CD2_SMIL_NAMESPACE_URI) ) 
+            aNewUri = SMIL_NAMESPACE_URI;
+        else if( aUri.equals(BASE_OFFICE_NAMESPACE_URI) &&
+                 (aPrefix == null || aPrefix.startsWith(BASE_OFFICE_NAMESPACE_PREFIX)) )
+            aNewUri = OFFICE_NAMESPACE_URI;
+        else if( aUri.equals(BASE_DB_NAMESPACE_URI) )
+            aNewUri = DB_NAMESPACE_URI;
+        
+        return aNewUri;
+    }
+
+    void namespaceUriAdapted( String aUri, String aNewUri )
+    {
+        String aMsg = (aUri.equals(BASE_OFFICE_NAMESPACE_URI) || aUri.equals(BASE_DB_NAMESPACE_URI))
+                ? "Adapting Base namspace'" + aUri + "'"
+                : "Adapting OpenDocument CD2 namspace'" + aUri + "' (has been stored by old OOo versions)";
+        m_aLogger.logInfo( aMsg , false);
+    }
+
+    @Override
+    public void startElement(String aUri, String aLocalName, String aQName, Attributes aAtts) throws SAXException {
+        if( aUri.equals(DRAW_NAMESPACE_URI) && 
+            (aLocalName.equals(POLYGON) || aLocalName.equals(POLYLINE) || aLocalName.equals(CONTOUR_POLYGON)) )
+        {
+            String aPointsValue = aAtts.getValue(DRAW_NAMESPACE_URI,POINTS);
+            if( aPointsValue != null && aPointsValue.length() > MAX_POINTS_LEN )
+            {
+                m_aLogger.logInfo( String.format("'draw:points' of <%s> has been stripped (value starts with '%s')",aQName,aPointsValue.substring(0,40)), false);
+                AttributesImpl aNewAtts = new AttributesImpl( aAtts );
+                int nAttr = aNewAtts.getIndex(DRAW_NAMESPACE_URI,POINTS);
+                int nPos = aPointsValue.lastIndexOf(' ',MAX_POINTS_LEN);
+                String aNewValue = nPos != -1 ? aPointsValue.substring(0,nPos) : "";
+                aNewAtts.setValue(nAttr, aNewValue );
+                aAtts = aNewAtts;
+            }
+        }
+        super.startElement(aUri, aLocalName, aQName, aAtts);
+    }
+
+}

Added: incubator/odf/trunk/validator/src/odfvalidator/DSigFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/DSigFilter.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/DSigFilter.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/DSigFilter.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,53 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+class DSigFilter extends NamespaceFilter {
+
+    private static final String OOO_DSIG_NAMESPACE_URI = "http://openoffice.org/2004/documentsignatures";
+    private static final String DSIG_NAMESPACE_URI = "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0";
+        
+    private Logger m_aLogger;
+    
+    /** Creates a new instance of KnownIssueFilter */
+    DSigFilter( Logger aLogger ) {
+        m_aLogger = aLogger;
+    }
+
+    String adaptNamespaceUri( String aUri, String aPrefix)
+    {
+        String aNewUri = null;
+        if( aUri.equals(OOO_DSIG_NAMESPACE_URI) )
+            aNewUri = DSIG_NAMESPACE_URI;
+        
+        return aNewUri;
+    }
+
+    void namespaceUriAdapted( String aUri, String aNewUri )
+    {
+        String aMsg = "Adapting dsig namspace'" + aUri + "'";
+        m_aLogger.logInfo( aMsg , false);
+    }
+
+
+}

Added: incubator/odf/trunk/validator/src/odfvalidator/InternalResources.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/InternalResources.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/InternalResources.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/InternalResources.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,43 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+public class InternalResources {
+
+    static final private String INTERNAL_RESOURCE_PREFIX = "internal:";
+
+    static boolean isInternalResourceIdentifer( String aPath )
+    {
+        return aPath.startsWith(INTERNAL_RESOURCE_PREFIX);
+    }
+    
+    static String getResourcePath( String aPath )
+    {
+        return "/".concat(aPath.substring(INTERNAL_RESOURCE_PREFIX.length()));
+    }
+    
+    static String createInternalResourceIdentifier( String aPath )
+    {
+        return INTERNAL_RESOURCE_PREFIX.concat(aPath);
+    }
+}

Added: incubator/odf/trunk/validator/src/odfvalidator/Logger.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/odfvalidator/Logger.java?rev=1172430&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/odfvalidator/Logger.java (added)
+++ incubator/odf/trunk/validator/src/odfvalidator/Logger.java Mon Sep 19 05:30:38 2011
@@ -0,0 +1,130 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ * 
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * 
+ * Use is subject to license terms.
+ * 
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ * 
+ * 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 odfvalidator;
+
+import java.io.PrintStream;
+
+import org.xml.sax.SAXParseException;
+
+class Logger {
+    
+    static final int INFO = 2;
+    static final int WARNING = 1;
+    static final int ERROR = 0;
+    
+    private String m_aFileName;
+    private String m_aEntryName;
+    private PrintStream m_aOut;
+    private boolean m_bError;
+    private int m_nLevel;
+    
+    private static final String INFO_PREFIX = "Info:";
+    private static final String WARNING_PREFIX = "Warning:";
+    private static final String ERROR_PREFIX = "Error:";
+    private static final String FATAL_PREFIX = "Fatal:";
+    
+    /** Creates a new instance of SchemaErrorHandler */
+    Logger( String aFileName, String aEntryName, PrintStream aOut , int nLevel) {
+        m_aFileName = aFileName;
+        m_aEntryName = aEntryName;
+        m_aOut = aOut;
+        m_nLevel = nLevel;
+        m_bError = false;
+    }
+
+    public void setOutputStream(PrintStream aOut) {
+        m_aOut = aOut;
+    }
+
+    boolean hasError()
+    {
+        return m_bError;
+    }
+
+    void logWarning(String aMsg) {
+        if( m_nLevel >= WARNING )
+            logMessage( WARNING_PREFIX, aMsg );
+    }
+
+    void logFatalError(String aMsg) {
+        logMessage( FATAL_PREFIX, aMsg );
+        m_bError = true;
+    }
+
+    void logError(String aMsg) {
+        if( m_nLevel >= ERROR )
+            logMessage( ERROR_PREFIX, aMsg );
+        m_bError = true;
+    }
+
+    void logInfo(String aMsg, boolean bForceOutput) {
+        if( m_nLevel >= INFO || bForceOutput )
+            logMessage( INFO_PREFIX, aMsg );
+    }
+    
+    void logWarning(SAXParseException e) {
+        if( m_nLevel >= WARNING )
+            logMessage( WARNING_PREFIX, e );
+    }
+
+    void logFatalError(SAXParseException e) {
+        logMessage( FATAL_PREFIX, e );
+        m_bError = true;
+    }
+
+    void logError(SAXParseException e) {
+        if( m_nLevel >= ERROR )
+            logMessage( ERROR_PREFIX, e );
+        m_bError = true;
+    }
+        
+    private void printFileEntryPrefix()
+    {
+        m_aOut.print( m_aFileName );
+        if( m_aEntryName != null && m_aEntryName.length() > 0 )
+        {
+            m_aOut.print( "/" );
+            m_aOut.print( m_aEntryName );
+        }
+    }
+
+    private void logMessage( String aPrefix, SAXParseException e )
+    {
+        printFileEntryPrefix();
+        m_aOut.print( "[" );
+        m_aOut.print( e.getLineNumber() );
+        m_aOut.print( "," );
+        m_aOut.print( e.getColumnNumber() );
+        m_aOut.print( "]:" );
+        m_aOut.print( aPrefix );
+        m_aOut.println( e.getMessage() );
+    }
+    
+    private void logMessage( String aPrefix, String aMsg )
+    {
+        printFileEntryPrefix();
+        m_aOut.print( ":" );
+        m_aOut.print( aPrefix );
+        m_aOut.println( aMsg);
+    }
+}



Mime
View raw message