Reputation: 2930
<xs:restriction base="xs:any">
Why cant I put restriction on any type like this?
Upvotes: 0
Views: 1083
Reputation: 35746
Because its meaningless, semantically it would be like the statment "You can't do nothing"
More syntactically, after reading about xs:restriction, I think that xs:any is not a built in data type, simpleType element or a complexType element but rather a place holder for extending a document with any element.
Upvotes: 1
Reputation: 13986
You can't put such restriction, because xs:any
is not a type.
If you want to derive a new type by restriction and you want the base type to be just anything (elements or text) then use <xs:restriction base="xs:anyType">
. If you are defining a simple type (text only), you can also use <xs:restriction base="xs:anySimpleType">
Upvotes: 1