ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Abley <james.ab...@volantis.com>
Subject Re: xmlvalidate with remote schemas
Date Mon, 25 Sep 2006 21:36:53 GMT
Try turning on grammar caching.

http://xml.apache.org/xerces2-j/faq-grammars.html#faq-4

I would imagine by doing something like this:

<attribute name="org.apache.xerces.xni.parser.XMLParserConfiguration" 
value="org.apache.xerces.parsers.XMLGrammarCachingConfiguration" />

or:

<property name="org.apache.xerces.xni.parser.XMLParserConfiguration" 
value="org.apache.xerces.parsers.XMLGrammarCachingConfiguration" />

Cheers,

James

Adrian Herscu wrote:
> Hi all,
> 
> I am using the <xmlvalidate> task in a Maven Ant mojo that validates XML
> files against XSD schemas.
> 
> <xmlvalidate>
>   <attribute name="http://xml.org/sax/features/validation" value="true"/>
>   <attribute name="http://apache.org/xml/features/validation/schema"
> value="true"/>
>   <attribute name="http://xml.org/sax/features/namespaces" value="true"/>
> 
>   <fileset dir="${sourceDirectory}">
>     <include name="**/*.xml" />
>   </fileset>
> 
> </xmlvalidate>
> 
> 
> Everything was working fine until I moved those schemas to SourceForge.
> Now the task fails erratically with this kind of errors:
> 
> [xmlvalidate] D:\mypath\myfile.xml:8:353: schema_reference.4: Failed to
> read schema document http://mydomain/schemas/myschema.xsd', because 1)
> could not find the document; 2) the document could not be read; 3) the
> root element of the document is not <xsd:schema>.
> [xmlvalidate] D:\mypath\myfile.xml:8:353: cvc-elt.1: Cannot find the
> declaration of element 'myrootelement'.
> 
> ...and sometimes with:
> 
> [xmlvalidate] http://mydomain/schemas/myschema.xsd:29:90:
> schema_reference.4: Failed to read schema document 'someimported.xsd',
> because 1) could not find the document; 2) the document could not be
> read; 3) the root element of the document is not <xsd:schema>.
> 
> And it takes it a very long time to complete (almost ten minutes for
> 70-80 XML files).
> 
> I tried to validate these files with MSXML4.0 and MSV and they validate.
> 
> Any suggestions? Timeouts?
> 
> Adrian.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 


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


Mime
View raw message