ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: xml Schema + ant+xerces-j2 =>validate => error?
Date Thu, 12 Feb 2004 09:06:51 GMT
Stefan Bodewig wrote:

>On Wed, 11 Feb 2004, Dominique Devienne <DDevienne@lgc.com> wrote:
>  
>
>>>From: Antoine Lévy-Lambert [mailto:antoine@antbuild.com] I wonder
>>>whether the xmlvalidate task supports *at all* xml schemas.
>>>      
>>>
>>It's supposed to, or at least that's what I remember reading from
>>Stefan,
>>    
>>
>
>Who only said that it was supposed to - and has never checked it.
>There is a unit test in Ant that actually checks for this.  It uses
>
>        <attribute name="http://xml.org/sax/features/validation"
>                   value="true"/>
>        <attribute name="http://apache.org/xml/features/validation/schema"
>                   value="true"/>
>
>within the task to enable XSD validation.
>
>  
>
This is for the target to check if the xml file is invalid. The target to
check if the xml file is valid is set up incorrectly.

src/etc/testcases/taskdefs/optional/xmlvalidate.xml:

  <target name="testSchemaGood">
    <xmlvalidate warn="false" lenient="no" >
      <fileset dir="xml" includes="endpiece.xml"/>

        <attribute name="http://xml.org/sax/features/validation"
                   value="false"/>
        <attribute name="http://apache.org/xml/features/validation/schema"
                   value="false"/>
    </xmlvalidate>
  </target>


When the values are set to "true", the xmlvalidation fails with the reason:
[xmlvalidate] 
/home/preilly/cvs/ant/src/etc/testcases/taskdefs/optional/xml/endpiece.xml:4:45: 
cvc-elt.1: Cannot find the declaration of element 'doc'.

Peter

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