Hopefully a simple knowledge question, but I can't seem to find an answer elsewhere.
What would be the impacts of having an element defined within a schema that was the following
<xs:element name"FooBar" />
Would it allow any data type or nothing at all?
To quote the standard, regarding how the type is resolved for an element (bolding added for clarity):
The type definition corresponding to the
<simpleType>
or<complexType>
element information item in the children, if either is present, otherwise the type definition resolved to by the actual value of the type attribute, otherwise the type definition of the element declaration resolved to by the actual value of the substitutionGroup attribute, if present, otherwise the ur-type definition
In your example, the element would resolve to the ur-type, i.e. xs:anyType
.
This allows any children, possibly mixed with text content, as long as it is well-formed XML.
Related: XML Schema: what's the default type of an xsd:attribute?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With