EDN Admin
Well-known member
I have been given an XSD from a 3 party company we need to validate against before submitting an XML file. For some reason some one of the elements causes issues when loading the schema.
The element is
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; element <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ContributorABN<span style="color:Black; " <span style="color:Red; nillable<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; true<span style="color:Black; " <span style="color:Red; default<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 00000000000<span style="color:Black; " <span style="color:Red; minOccurs<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; simpleType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; restriction <span style="color:Red; base<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; xs:integer<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; pattern <span style="color:Red; value<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ^[0-9]{11}$|^[0-9]{14}$<span style="color:Black; "<span style="color:Blue; />
<span style="color:Green; <!--<xs:totalDigits value="11" />-->
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; restriction<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; simpleType<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; element<span style="color:Blue; >
[/code]
When i load the schema via IXMLDOMSchemaCollection2Ptr->add i get an error stating its not valid :
"00000000000 violates pattern constraint of ^[0-9]{11}$|^[0-9]{14}$.
the deafault shoulod work as far as i can see.
I am using MSXML6 and the program is written in C++.
I questioned the syntax of the regex expression in the pattern as it seems not be XML conform. Funny thing is though if i use C# and XMLValidationReader or XMLReader the validation works fine.
Anyone any ideas ?
View the full article
The element is
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; element <span style="color:Red; name<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ContributorABN<span style="color:Black; " <span style="color:Red; nillable<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; true<span style="color:Black; " <span style="color:Red; default<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 00000000000<span style="color:Black; " <span style="color:Red; minOccurs<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; simpleType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; restriction <span style="color:Red; base<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; xs:integer<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; pattern <span style="color:Red; value<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ^[0-9]{11}$|^[0-9]{14}$<span style="color:Black; "<span style="color:Blue; />
<span style="color:Green; <!--<xs:totalDigits value="11" />-->
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; restriction<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; simpleType<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; xs<span style="color:Blue; :<span style="color:#A31515; element<span style="color:Blue; >
[/code]
When i load the schema via IXMLDOMSchemaCollection2Ptr->add i get an error stating its not valid :
"00000000000 violates pattern constraint of ^[0-9]{11}$|^[0-9]{14}$.
the deafault shoulod work as far as i can see.
I am using MSXML6 and the program is written in C++.
I questioned the syntax of the regex expression in the pattern as it seems not be XML conform. Funny thing is though if i use C# and XMLValidationReader or XMLReader the validation works fine.
Anyone any ideas ?
View the full article