Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The XSD snippets are valid, so the <a href="http://www.w3.org/TR/xmlschema-1/#a-props-correct" rel="nofollow">error you're getting</a> makes no sense. I believe it is rather a bug in your WMB software. </p> <p>What version of WMB are you using?</p> <p>Since you seem to be able to play with the XSD, it would also help with troubleshooting if instead of removing the default attribute, try to rewrite the pattern from one with the value of "0|1", into two separate patterns, one with a value of "0", and another with the value of "1". I've seen before with other products from the same vendor where patterns associated with xsd:boolean fail miserably.</p> <p>UPDATE: Since posting this, I've ran myself into this and other similar scenarios, and realized that schema processors behave differently while validating what seems to be basically the same thing: a schema that correct according to the spec, yet practically it describes an impossibility. And this is where things get interesting as to what <em>correct</em> is.</p> <p>This case is a bit more subtle maybe, since it involves getting <a href="http://www.w3.org/TR/xmlschema-1/#sic-attrDefault" rel="nofollow">this</a> and <a href="http://www.w3.org/TR/xmlschema-2/#boolean" rel="nofollow">this</a> right; basically if a default kicks in, it'll use the canonical representation of the associated value (not the string in the default value!). Since <strong>1</strong> means <strong>True</strong> for a boolean, the canonical representation of that is the string <strong>true</strong> which now obviously doesn't match the pattern (which deals with the lexical representation - string basically) <strong>0|1</strong> which in turn makes these two incompatible. Considering PSVI, an XML processor that is XSD aware cannot create valid XML when applying the default. This is what the error message says.</p> <p>To show other imposibility that is not flagged by any XSD processor I am typically using, consider this particular snippet:</p> <pre><code>&lt;xsd:complexType name="Test"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="Impossible" type="Test"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:element name="Test" type="Test"/&gt; </code></pre> <p>It is impossible to create a valid XML out of this XSD, just as having a default="1" and attribute missing in your case (of pattern restricted to 0 and 1).</p> <p>To me, both scenarios are <em>somewhat</em> similar to a code compiler catching (at compile time) a divide by zero condition - where it can.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload