Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: [XML Schema 1.1] I need an example that illustrates the >Thread Next - RE: [XML Schema 1.1] I need an example that illustrates the RE: [XML Schema 1.1] I need an example that illustrates theTo: "xmlschema-dev@--.---" <-------------@--.---> Date: 7/22/2009 5:59:00 PM Hi Michael, > A schema for XSLT, for example, might enforce a rule that > XSLT templates must have either a name or a match attribute > by declaring the xsd:template element thus: > > <element name="template"> > <alternative test="@name" type="xslt:named-template"/> > <alternative test="@match" type="xslt:template"/> > <alternative type="xsd:error"/> > </element> Doesn't this achieve the same result (I simply omitted the third alternative): <element name="template"> <alternative test="@name" type="xslt:named-template"/> <alternative test="@match" type="xslt:template"/> </element> In this version an error is generated if there is neither a name attribute or a match attribute. I like this one: > <override schemaLocation="main.path.to.V"> > <element name="E" type="error"/> > <!--* other elements can be excluded here by the same > * method ... *--> > </override> Thanks. /Roger | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
