You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by srikanth kapila <sr...@gmail.com> on 2011/06/28 07:30:09 UTC

Schema validation in java sucessed but fails in c++.

Hi all,

I am using xerces 2.7 version of java and c/c++ in my product. I see a
difference in schema validation done by xerces in c and that of xerces in
java. Xerces in c correctly marks this error, where as the schema validation
is successful in java. 

I have written a small java program with a sample xml to reproduce this
problem. 

For the c,c++ implementation, I am using an open source implementation
called ovaldi which internally uses xerces. You can download ovaldi from
http://sourceforge.net/projects/ovaldi/files/ovaldi/.

To run this xml use the following line ovaldi.exe -m -o oval.xml <<the xml
that is attached with this post>>, you can see this correctly reports the
following error

===================================================
    - validating xml schema.
Error while parsing xml file:
        Severity: Error
        Message: Attribute 'datatype' has a value, 'string', that does not
match its #FIXED value, '
boolean'
        File: d:\win7\CIS_Windows_7_Benchmark_v1.1.0_oval.xml
        Line 59
        At char 93
===================================================

In the following xml, the following line is incorrect.
<password_complexity datatype="string" operation="equals"
var_ref="oval:dummy:var:6"/>
Correct line is 
<password_complexity datatype="boolean" operation="equals"
var_ref="oval:dummy:var:6"/>

This is because the schema specifies the datatype value is only of type
boolean for password_complexity.

I hava attached a simple xml  http://old.nabble.com/file/p31943477/oval.xml
oval.xml  which can reproduce this problem.

Also a sample java program  http://old.nabble.com/file/p31943477/Dummy.java
Dummy.java 

The schema files needed are attached in the zip file
http://old.nabble.com/file/p31943477/xml.zip xml.zip 


Can some one help me on this ?

Regards,
Srikanth
-- 
View this message in context: http://old.nabble.com/Schema-validation-in-java-sucessed-but-fails-in-c%2B%2B.-tp31943477p31943477.html
Sent from the Xerces - J - Dev mailing list archive at Nabble.com.


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