Hi Guillaume,
   First of all, this implementation behavior could not be a bug with
a XML Schema engine, as XSD specification doesn't recommend anything
about details of the error reporting, upon XML Schema validation
failure.

To my opinion, at the least XSD implementations are expected to report
validation success or failure (i.e, a kind of 'true' or 'false'
validation outcome) after a XML schema validation episode. How
validation error messages are constructed, and how much of error
reporting is performed by schema engines, is implementation dependent.

In this particular case, reporting all instances of
identity-constraint violations may be a nice to have feature (but
IMHO, it's still debatable, whether this is a best design in this
case), but not doing so, doesn't make Xerces non-compliant to XSD spec
:)

It seems to me, that seeing all of identity-constraint violations if
error instances are as less as 2-3, may be good to see. But if let's
say we make the error list unbounded, producing all the error
instances (imagine this list size to be say, 500!) could be unpleasant
to see.

On Fri, May 21, 2010 at 2:43 PM, Guillaume Deshors
<[email protected]> wrote:
> Hi
>
> I am facing exactly the issue reported by this oxygen user :
> http://www.oxygenxml.com/forum/topic2869.html?sid=a4b044cdcc3c06ae07059f924156f6d3
> When using several keyrefs causing errors, Xerces reports only the first and
> then gives up.
>
> I would really like to have Xerces report all foreign key errors, like I've
> seen with the saxon or libXml parsers. Is there a way to do that ?
>
> I've done a few hours of search and I've read that it is a fatal error to
> Xerces and that's why it stops. I've tried to set continue-after-fatal-error
> to true but it didn't change anything ; anyway I've read that it's not
> recommended to set this option in a production environment.
>
> I'm joining a sample XML and XSD files that show my problem. In my example,
> each ASSREGARD references a ASSFILDO, I've created two bad ASSREGARD that
> reference non-existent ASSFILDO. Then Xerces reports only :
>      Description: [Xerces] cvc-identity-constraint.4.3: Key
> 'FK_ASSFILDOREGARD' with value 'non-existent1' not found for identity
> constraint of element 'FeatureCollection'.
>      URL: http://www.w3.org/TR/xmlschema-1/#cvc-identity-constraint
>
> Instead of this I would like it to report both errors, on non-existent1 and
> non-existent2. Thank you very much for any support !
>
> Regards, Guillaume
>
> Here are the two files :
>
> ----> keyrefDemo.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <glml:FeatureCollection
>     xmlns:gml="http://www.opengis.net/gml";
>     xmlns:glml="http://www.grandlyon.com/glml";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="http://www.grandlyon.com/glml ./keyrefDemo.xsd"  >
>
>     <glml:ASSFILDO>
>         <glml:IID_IDENTFILDO>28532</glml:IID_IDENTFILDO>
>     </glml:ASSFILDO>
>
>     <glml:ASSREGARD>
>         <glml:IID_IDENTREGARD>23797</glml:IID_IDENTREGARD>
>         <glml:IID_ASSFILDO>28532</glml:IID_ASSFILDO>
>     </glml:ASSREGARD>
>
>     <glml:ASSREGARD>
>         <glml:IID_IDENTREGARD>bad1</glml:IID_IDENTREGARD>
>         <glml:IID_ASSFILDO>non-existent1</glml:IID_ASSFILDO>
>     </glml:ASSREGARD>
>
>     <glml:ASSREGARD>
>         <glml:IID_IDENTREGARD>bad2</glml:IID_IDENTREGARD>
>         <glml:IID_ASSFILDO>non-existent2</glml:IID_ASSFILDO>
>     </glml:ASSREGARD>
>
> </glml:FeatureCollection>
>
>
> -----> keyrefDemo.xsd
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <schema targetNamespace="http://www.grandlyon.com/glml";
> xmlns:glml="http://www.grandlyon.com/glml";
>     xmlns:xlink="http://www.w3.org/1999/xlink";
>     xmlns="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
> version="0.9">
>
>     <!-- element -->
>     <element name="FeatureCollection">
>         <complexType>
>             <sequence>
>
>                 <element name="ASSFILDO" maxOccurs="unbounded" >
>                     <complexType>
>                         <sequence>
>                             <element name="IID_IDENTFILDO" type="string" />
>                         </sequence>
>                     </complexType>
>                 </element>
>
>                 <element name="ASSREGARD" maxOccurs="unbounded" >
>                     <complexType>
>                         <sequence>
>                             <element name="IID_IDENTREGARD" type="string" />
>                             <element name="IID_ASSFILDO" type="string" />
>                         </sequence>
>                     </complexType>
>                 </element>
>
>             </sequence>
>         </complexType>
>
>         <key name="PK_ASSFILDO">
>             <selector xpath="glml:ASSFILDO"/>
>             <field xpath="glml:IID_IDENTFILDO"/>
>         </key>
>
>         <key name="PK_ASSREGARD">
>             <selector xpath="glml:ASSREGARD"/>
>             <field xpath="glml:IID_IDENTREGARD"/>
>         </key>
>
>         <keyref name="FK_ASSFILDOREGARD" refer="glml:PK_ASSFILDO">
>             <selector xpath="glml:ASSREGARD"/>
>             <field xpath="glml:IID_ASSFILDO"/>
>         </keyref>
>
>     </element>
>
> </schema>



-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to