Dominating
Dominating

Reputation: 2930

Problem with restriction in xsd

<xs:restriction base="xs:any">

Why cant I put restriction on any type like this?

Upvotes: 0

Views: 1083

Answers (2)

Jodrell
Jodrell

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

jasso
jasso

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

Related Questions