Browse Source

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.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273306 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 23 years ago
parent
commit
41f77159fb
4 changed files with 61 additions and 1 deletions
  1. +21
    -0
      src/etc/testcases/taskdefs/optional/xml/doc.xsd
  2. +9
    -0
      src/etc/testcases/taskdefs/optional/xml/endpiece.xml
  3. +10
    -0
      src/etc/testcases/taskdefs/optional/xml/endpiece2.xml
  4. +21
    -1
      src/etc/testcases/taskdefs/optional/xmlvalidate.xml

+ 21
- 0
src/etc/testcases/taskdefs/optional/xml/doc.xsd View File

@@ -0,0 +1,21 @@
<?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>

+ 9
- 0
src/etc/testcases/taskdefs/optional/xml/endpiece.xml View File

@@ -0,0 +1,9 @@
<?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>

+ 10
- 0
src/etc/testcases/taskdefs/optional/xml/endpiece2.xml View File

@@ -0,0 +1,10 @@
<?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>

+ 21
- 1
src/etc/testcases/taskdefs/optional/xmlvalidate.xml View File

@@ -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>

Loading…
Cancel
Save