IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Validating an XML against a XSD Options · View
TheVenkster
Posted: Tuesday, March 26, 2019 2:03:19 AM
Rank: Newbie

Joined: 3/26/2019
Posts: 2
Location: NJ, USA
Hi:

When I created an XML and tried to validate it against its XSD, I get the following errors. The first one I can fix since the value is not one of the enumerations.

But I fail to understand the cause of the other two (same kind) of exceptions:

File D:\Personal Data\Genpact\PVAI\MatchpointCoder\SampleRequestMessage-FromBayer.xml is not valid.
Value '' is not allowed for element <subjectGender>.
Reason: it does not match any of the defined enumerations (see below)
'F'
'M'
Annotations of element 'subjectGender' (see below)
Leaf node of type string(1). If specified, must be one of M (male) or F
(female).
Error location: MPWS / body / subject / subjectGender / [TEXT]
Details
cvc-enumeration-valid: '' is none of the values specified by the enumerations of type 'clGender'.
cvc-facet-valid.1: The value '' is not facet-valid with respect to the constraining facets of type definition 'clGender'.
cvc-datatype-valid.2: The value '' is not facet-valid with respect to the facets of type definition 'clGender'.
cvc-simple-type.1: For type definition 'clGender' the string '' is not valid.
cvc-type.3.1.3: The normalized value '' is not valid with respect to the type definition 'clGender'.
cvc-elt.5.2.1: The element <subjectGender> is not valid with respect to the actual type definition 'clGender'.
cvc-assess-elt.1.1: Strict assessment of element <subjectGender> with governing element declaration 'subjectGender' failed.
Element <termType> is not allowed at this location under element <record>.
Reason: The following elements are expected at this location (see below)
'recordID'
Error location: MPWS / body / records / record / termType
Details
cvc-complex-type.1.4: Element <termType> unexpected at this location by type '{anonymous}' of element <record>.
cvc-type.3.2: Element <record> is not valid with respect to type definition '{anonymous}'.
cvc-elt.5.2.1: The element <record> is not valid with respect to the actual type definition '{anonymous}'.
Element <termType> is not allowed at this location under element <record>.
Reason: The following elements are expected at this location (see below)
'recordID'
Error location: MPWS / body / records / record / termType
Details
cvc-complex-type.1.4: Element <termType> unexpected at this location by type '{anonymous}' of element <record>.
cvc-type.3.2: Element <record> is not valid with respect to type definition '{anonymous}'.
cvc-elt.5.2.1: The element <record> is not valid with respect to the actual type definition '{anonymous}'.

Thanks,

Venki

File Attachment(s):
MPCW-RequestMessage.xsd (18kb) downloaded 339 time(s).
SampleRequestMessage.xml (2kb) downloaded 330 time(s).


TheVenkster
Posted: Tuesday, March 26, 2019 1:20:37 PM
Rank: Newbie

Joined: 3/26/2019
Posts: 2
Location: NJ, USA
Well, a little research taught me something new!

The key is xs:sequence. If this is used, the elements in the XML have to be in the same order as specified in the XSD.

As opposed to xs:all in which case the order can be different.

Venki
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.