stevel 2002/09/08 19:37:50
Modified: src/etc/testcases/taskdefs/optional xmlvalidate.xml
Added: src/etc/testcases/taskdefs/optional/xml doc.xsd endpiece.xml
endpiece2.xml
Log:
Tests for XML schema support. I think we have issues w.r.t catalogs, dtd and
Schema, or at least need some docs on the subject.
Revision Changes Path
1.4 +21 -1
jakarta-ant/src/etc/testcases/taskdefs/optional/xmlvalidate.xml
Index: xmlvalidate.xml
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/etc/testcases/taskdefs/optional/xmlvalidate.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xmlvalidate.xml 1 Jun 2002 12:26:37 -0000 1.3
+++ xmlvalidate.xml 9 Sep 2002 02:37:50 -0000 1.4
@@ -29,7 +29,7 @@
<xmlvalidate warn="false">
<fileset dir="xml" includes="**/about.xml"/>
<xmlcatalog classpath="xml">
- <entity publicID = "bogusImage"
+ <entity publicID = "bogusImage"
location = "/i/dont/exist.jpg"/>
<xmlcatalog>
<dtd publicID="-//stevo//DTD doc 1.0//EN"
@@ -39,4 +39,24 @@
</xmlvalidate>
</target>
+ <target name="testSchemaGood">
+ <xmlvalidate warn="false">
+ <fileset dir="xml" includes="endpiece.xml"/>
+ <feature name="http://xml.org/sax/features/validation" value="true"/>
+ <feature name="http://apache.org/xml/features/validation/schema"
value="true"/>
+ <xmlcatalog >
+ <entity publicID = "nap:Massive+Attack+Mezzanine"
+ location = "xml/doc.xsd"/>
+ </xmlcatalog>
+ </xmlvalidate>
+ </target>
+
+ <target name="testSchGemaBad">
+ <xmlvalidate warn="false">
+ <fileset dir="xml" includes="endpiece2.xml"/>
+ <feature name="http://xml.org/sax/features/validation" value="true"/>
+ <feature name="http://apache.org/xml/features/validation/schema"
value="true"/>
+ </xmlvalidate>
+ </target>
+
</project>
1.1
jakarta-ant/src/etc/testcases/taskdefs/optional/xml/doc.xsd
Index: doc.xsd
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="doc">
<xs:complexType>
<xs:sequence>
<xs:element ref="section"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="section">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="title" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
1.1
jakarta-ant/src/etc/testcases/taskdefs/optional/xml/endpiece.xml
Index: endpiece.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="doc.xsd"
xmlns="nap:Massive+Attack+Mezzanine">
<section title="endpiece">
With a little luck, the network will pick me up.
This is Ripley - last survivor of The Nostromo - signing off.
</section>
</doc>
1.1
jakarta-ant/src/etc/testcases/taskdefs/optional/xml/endpiece2.xml
Index: endpiece2.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="doc.xsd"
xmlns="nap:Massive+Attack+Mezzanine">
<section title="endpiece">
With a little luck, the network will pick me up.
This is Ripley - last survivor of The Nostromo - signing off.
<illegal-element/>
</section>
</doc>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>