Essadiq BAICH
Essadiq BAICH

Reputation: 11

Is there a way to reuse asserts in XML schema?

Suppose I have a set of asserts I defined in a complexType, how can I reuse the same asserts in another complexType or element ?

Does asserts get inherited when using type extension/restriction ?

The only way I can think of is using defining the asserts conditions in dtd entities and then reuse them when needed.

Upvotes: 1

Views: 75

Answers (1)

Michael Kay
Michael Kay

Reputation: 163322

If there's a logical relationship between the types then you could perhaps make the two types subtypes of some abstract supertype.

Otherwise, as you say, you're left with DTD entities or other textual transclusion mechanisms.

Upvotes: 1

Related Questions