You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Kale54 <ka...@katamail.com> on 2007/08/08 16:19:56 UTC

[Fwd: Error in SchemaValidate using OASIS XML Catalog]

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: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: [Fwd: Error in SchemaValidate using OASIS XML Catalog]

Posted by Jacob Kjome <ho...@visi.com>.
I see at least one 
problem.  "D:\TestsRoot\resources\Schemas\envelope.xsd" is not a 
valid URI.  Try....

file:/D:/TestsRoot/resources/Schemas/envelope.xsd

I'm not sure if the <catalogpath> "path" attribute requires a URI or 
if it automatically formats file system paths to be proper URI's.  In 
any case, you at least need to change the path in the catalog itself.


Jake

At 09:19 AM 8/8/2007, you wrote:
 >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: j-users-unsubscribe@xerces.apache.org
 >For additional commands, e-mail: j-users-help@xerces.apache.org
 >
 >
 >
 > 


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org