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.

Profile: TheVenkster
About
User Name: TheVenkster
Forum Rank: Newbie
Real Name:
Location NJ, USA
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Tuesday, March 26, 2019
Last Visit: Tuesday, March 26, 2019 1:20:57 PM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Validating an XML against a XSD
Posted: Tuesday, March 26, 2019 1:20:37 PM
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
Topic: Validating an XML against a XSD
Posted: Tuesday, March 26, 2019 2:03:19 AM
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

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