You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Ruibo Cai <ru...@utstar.com> on 2008/04/18 02:55:56 UTC

SAX schema validation

Hi,

I am new to XERCES.

I'm trying out some of the sample codes come with xerces c++. 

I created a xsd file and a xml file corresponding to it.

Then , I ran :

./DOMPrint -v=always -n -s -f test.xml

It prints out the whole test.xml without any error.

When I tried to use SAXPrint on the same test.xml file by running:

./SAX2Print -v=always -n -s -f test.xml

I got "Unknown element" errors for almost each line of the test.xml
file.

 

Here my question is:

Does XML schema based validation work for SAX or SAX2 at all?

 

Thanks

Ruibo


Re: SAX schema validation

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Alberto,

Alberto Massari <am...@datadirect.com> writes:

> SAX2Print treats the options -n -s in the OPPOSITE way (they disable
> namespaces and schema support)

Should we change this in 3.0.0 so that all examples are consistent?

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

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


Re: SAX schema validation

Posted by Alberto Massari <am...@datadirect.com>.
Ruibo Cai wrote:
>
> Hi,
>
> I am new to XERCES.
>
> I’m trying out some of the sample codes come with xerces c++.
>
> I created a xsd file and a xml file corresponding to it.
>
> Then , I ran :
>
> ./DOMPrint -v=always -n -s -f test.xml
>
> It prints out the whole test.xml without any error.
>
> When I tried to use SAXPrint on the same test.xml file by running:
>
> ./SAX2Print -v=always -n -s -f test.xml
>
> I got “Unknown element” errors for almost each line of the test.xml file.
>
> Here my question is:
>
> Does XML schema based validation work for SAX or SAX2 at all?
>
> Thanks
>
> Ruibo
>


SAX2Print treats the options -n -s in the OPPOSITE way (they disable 
namespaces and schema support), so you have to remove them from your 
command line.

Alberto


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