Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: XML Schema validation doesnt throw some basic errors?

From: "Michael Kay" <mike@--------.--->
To: "'MM'" <manoj_madhavan@----------.--->, <xmlschema-dev@--.--->
Date: 1/10/2007 8:39:00 PM
> 1) If a complex type has 10 elements which are defined as 
> mandatory in my schema. In my xml instance if I put only the 
> 10th element, on validating this against the schema, I get 
> only 1 error saying that 'found {10th element} while 
> expecting 9th element.
> It doent say that the other 8 elements were missing. I've 
> enabled full-schema-checking. I want to collect all errors at 
> one go and dont want to get one error at a time. Is there a 
> way to achieve this?

I would think it unlikely that any implementation will give you more that
one error message for a sequence of sibling elements that doesn't match the
content model of the parent element. But error reporting depends entirely on
the implementation so you would be better off asking on a product-specific
list.

> 2) If i put a junk element which is not at all defined in the 
> schema just before closing my <root> tag, the schem 
> validation doesnt catch this. For
> eg: in the below xml
> <root>
>   <element_defined_in_schema_1>..</element_defined_in_schema_1>
>   ....
>   ....
>   <element_not_defined_in_schema>junk</element_not_defined_in_schema>
> </root>
> 
> schema validation doesnt throw an error saying that 
> "element_not_defined_in_schema" is not a valid one.
> 

My instinct is to say: prove it. Given that you haven't shown us the
evidence (full schema and instance document), my guess is that it's more
likely you have made a mistake than that Xerces has got this wrong.

Michael Kay
http://www.saxonica.com/


From prvs=manoj_madhavan=523826381@f... Wed Jan 10 22:00:47 2007


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent