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 Ma...@cataloga.com on 2001/08/15 10:37:34 UTC

Schema Validation Error reporting

Hi All,

We are using Xerces 1.4.2 and validating our documents against schemas.
When an error is found a very terse message is returned without context.
See example below.

                <xsd:element name="repeatingGroup" minOccurs="1"
maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="primaryKey" minOccurs="1"
maxOccurs="1">
                                <xsd:simpleType>
                                    <xsd:restriction base="xsd:string">
                                        <xsd:maxLength value="50"/>
                                    </xsd:restriction>
                                </xsd:simpleType>
                            </xsd:element>
                            <xsd:element name="optionalAttribute"
minOccurs="0" maxOccurs="1">
                                <xsd:simpleType>
                                    <xsd:restriction base="xsd:string">
                                        <xsd:maxLength value="255"/>
                                    </xsd:restriction>
                                </xsd:simpleType>
                            </xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>

	If I leave out primaryKey...
	ERROR Message : The content of element type "repeatingGroup" must
match "(primaryKey,optionalAttribute?)".

I can infer from the error message what is wrong but I do not have context
for where this is, especially in a large document.  

Is any work occurring to improve the error reporting so the user has better
information for correcting the document they wish to validate?

Our current thinking is to keep context from the SAX callbacks and produce
our own error messages but this seems like what should be a feature of the
validator????

Regards,
Martin....

_______________________________________________________
DATA SECURITY - PLEASE READ
This communication may contain information which is CATALOGA confidential
and may also be privileged. It is for exclusive use of the intended
recipient(s). If you are not the intended recipient(s) please note that any
form of distribution, copying or use of this communication or information in
it, is strictly prohibited and may be unlawful. 

If you have received this communication in error please forward it to
administrator@cataloga.com, then delete the email and destroy any copies of
it.

Thank you for your cooperation.
_______________________________________________________

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