Hi all,
I'm trying the "SchemaValidate"ANT-task (with Xerces tool) onto this
sample-soap message (file=soapRequest.xml"):

<SOAP-ENV:Envelope xmlns:SOAP-ENV =
"http://schemas.xmlsoap.org/soap/envelope/"; xmlns:SVIM =
"http://www.svimservice.it/Schemas/PDD_SISR/SCATEL/"; xmlns:xsi =
"http://www.w3.org/2001/XMLSchema-instance"; >
    <SOAP-ENV:Header  />
    <SOAP-ENV:Body>
         <SVIM:setDocRegister>
              <SVIM:myDataSection>my text data
              </SVIM:myDataSection>
                        </SVIM:setDocRegister>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

using the following Build file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Validazione stringhe XML rispetto allo Schema"
basedir="." default="all">
   <tstamp />
   <target name="all">
   <record name="log.txt" action="start" loglevel="verbose"/>
  <schemavalidate  failonerror="no" warn="yes"
classname="org.apache.xerces.parsers.SAXParser" file="${oFile}">
       <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"/>
            <xmlcatalog>
               <catalogpath
path="D:/CanooWebTest/jobScripts/XML_Catalog_Locale_1.xml" />
            </xmlcatalog>
   </schemavalidate>
   </target>
</project>

As one can see the binding of XML-schemas and the relative files is done
with the help of a OASIS XML Catalog that hold some entries like:

<uri name="http://schemas.xmlsoap.org/soap/envelope/";
uri="D:\TestsRoot\resources\Schemas\envelope.xsd" />

But the validation process fails with this partial log:
...

...
[schemavalidate] D:\TestsRoot\PDDSISR\BatchTests\soapRequest.XML:1:204:
cvc-elt.1: Cannot find the declaration of element 'SOAP-ENV:Envelope'.
[schemavalidate] D:\TestsRoot\PDDSISR\BatchTests\soapRequest.XML is not
a valid XML document
....

I'm sure that all jar files, included "resolver.jar", are in correct
Classpath.
What's wrong about catalog? Can anyone help me?
Thanks in advance for any suggestion.
Vito





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to