ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike <...@good-with-numbers.com>
Subject using internal parameter entities and Schema with xmlvalidate
Date Thu, 20 Nov 2003 04:14:30 GMT
I would like to validate my instance document--which uses an internal DTD
subset to define parameter entities--against a schema, much like the example
in Appendix C of the _XML Schema Part 0: Primer_:

----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE projects [
  <!ENTITY nbsp "&#160;">
  <!ENTITY Ouml "&#214;">
  <!ENTITY mdash "&#8212;">
]>

<projects xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xsi:noNamespaceSchemaLocation="projects.xsd"
	  >
----------------------------------------------------------------------

I use the following Ant code:

----------------------------------------------------------------------
<xmlvalidate file="${src.dir}/web/projects.xml"
	     classname="org.apache.xerces.parsers.SAXParser"
	     >
  <attribute
    name="http://xml.org/sax/features/validation"
    value="true"/>
  <attribute
    name="http://apache.org/xml/features/validation/schema"
    value="true"/>
  <attribute
    name="http://apache.org/xml/features/validation/schema-full-checking"
    value="true"/>
  <attribute
    name="http://java.sun.com/xml/jaxp/properties/schemaLanguage"
    value="http://www.w3.org/2001/XMLSchema"/>
</xmlvalidate>
----------------------------------------------------------------------

This gives me the error:

  Parser org.apache.xerces.parsers.SAXParser doesn't recognize feature http://java.sun.com/xml/jaxp/properties/schemaLanguage

which seems odd, since I'm using Ant 1.6beta2, which contains Xerces 2.5.0,
which, by all accounts on the Xerces list, supports that feature.  In fact,
the list suggests setting that feature to address exactly the problem I'm
having.  If I remove that <attribute>, I get a series of messages like:

  Element type "projects" must be declared.

as if it were trying to do DTD-only validation.


I've had success in validating another document that doesn't use entities,
against another schema.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message