Element value does not conform to a pattern defined by the schema. 

Notice! This page describes the nature of the error using a hypothetical example and not the erroneous data of the input test file. You should however be able to apply this information to your error case.

Error description:

Element value does not conform to a pattern defined by the schema. This error could also be caused by extra white spaces or line feeds in the value. 

Patterns are also known as regular expressions. In case you don't know how to read the patterns you can read more e.g. from wikipedia.

Example 1:


In this example the country code value of the element <Ctry> is not following the pattern which is defined by the schema. The pattern in here is [A-Z]{2,2} which means the value should contain exactly two characters. Correct value would be e.g.


Example 2:

BIC code is defined by the ISO20022 schemas with a pattern as follows:

    <xs:simpleType name="BICIdentifier">
        <xs:restriction base="xs:string">
            <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>

The pattern can be read so that BIC code should have 6 upper case characters between A-Z, after that either an A-Z letter or a number between 2-9, a character/number between A-N or P-Z or 0-9, and finally an optional (as indicated by the {0,1} after the parenthesized segment) choice of exactly three characters between A-Z or 0-9.


Explanation of the error message given by the validator:

"Element 'elem1': [facet 'pattern'] The value 'someValue' is not accepted by the pattern 'regularExpressionPattern'."

Where elem1 is the element which has invalid value someValue, value is invalid because it is not accepted by the pattern which is described at the end of the error message.