[jdom-interest] org.jdom.contrib.schema update
Laurent Bihanic
laurent.bihanic at atosorigin.com
Fri Jun 27 06:31:00 PDT 2003
Attached is a patch to fix Javadoc and typos in comment in Schema.java
(Schema.diff) and a patch for the jdom-contrib build.xml not to compile the
org.jdom.contrib.schema package if the JARV JARs are not present in the classpath.
Laurent
--
wWw
(o o)
-------------ooO-(_)-Ooo-----------------------------------------------
Laurent Bihanic | Tel: +33 (0)1 55.91.21.93 (direct)
AtosOrigin Systems Integration | +33 (0)1 55.91.20.00
e-Business / SC | Fax: +33 (0)1 55.91.22.31
Les Miroirs - Bat. C |
18, avenue d'Alsace |
F-92926 La Defense Cedex | E-mail: laurent.bihanic at atosorigin.com
-----------------------------------------------------------------------
"Microsoft isn't the answer. Microsoft is the question and the answer
is no."
DISCLAIMER:
The opinions expressed are entirely my own and may not necessarily be
those of my employer. Also, I am not now nor have I ever been a
lawyer. My opinions are provided as-is with absolutely no warrantee of
merchantability or fitness for any particular use. Besides, you can't
prove I typed this. No body saw me type this. Who says I typed this?
-------------- next part --------------
Index: Schema.java
===================================================================
RCS file: /home/cvspublic/jdom-contrib/src/java/org/jdom/contrib/schema/Schema.java,v
retrieving revision 1.1
diff -r1.1 Schema.java
97,98c97,98
< *
< * To validate a document against a W3C XML Schema definition:
---
> * <p>
> * To validate a document against a W3C XML Schema definition:</p>
100,115c100,116
< import org.jdom.contrib.schema.Schema;
<
< String uri = <The URL of the schema document>;
< Document doc = <a JDOM document>;
<
< Schema schema = Schema.parse(uri, Schema.W3C_XML_SCHEMA);
< List errors = schema.validate(doc);
< if (errors != null) {
< // Validation errors
< for (Iterator i=errors.iterator(); i.hasNext(); ) {
< ValidationError e = (ValidationError)(i.next());
< System.out.println(e);
< }
< }
< // Else: No error, document is valid.
< </pre>
---
> * import org.jdom.contrib.schema.Schema;
> *
> * String uri = <The URL of the schema document>;
> * Document doc = <a JDOM document>;
> *
> * Schema schema = Schema.parse(uri, Schema.W3C_XML_SCHEMA);
> * List errors = schema.validate(doc);
> * if (errors != null) {
> * // Validation errors
> * for (Iterator i=errors.iterator(); i.hasNext(); ) {
> * ValidationError e = (ValidationError)(i.next());
> * System.out.println(e);
> * }
> * }
> * // Else: No error, document is valid.
> * </pre>
> * <p>
118c119
< * (calling validate(Element) on another Schema) but not for attributes.
---
> * (calling validate(Element) on another Schema) but not for attributes.</p>
260c261
< catch (SAXException e) { /* Fatal validation error encounted. */
---
> catch (SAXException e) { /* Fatal validation error encountered. */
291c292
< catch (SAXException e) { /* Fatal validation error encounted. */
---
> catch (SAXException e) { /* Fatal validation error encountered. */
-------------- next part --------------
Index: build.xml
===================================================================
RCS file: /home/cvspublic/jdom-contrib/build.xml,v
retrieving revision 1.20
diff -r1.20 build.xml
105a106
>
107c108
< <property name="isorelax.jar" value="${lib.dir}/isorelax.jar"/>
---
> <property name="iso-relax-api.jar" value="${lib.dir}/isorelax.jar"/>
115c116
< <pathelement location="${isorelax.jar}"/>
---
> <pathelement location="${iso-relax-api.jar}"/>
197a199,204
>
> <!-- Compile the schema package only if the JARV classes are found -->
> <available property="jarv.present"
> classname="org.iso_relax.verifier.Verifier"
> classpathref="compile.class.path" />
>
203a211
> <exclude name="**/schema/*.java" unless="jarv.present" />
More information about the jdom-interest
mailing list