Alex Milowski wrote:
> Attached are a set of schemas with two substitution group 'xhtml:block' and
> 'xhtml:inline'. I've tried to add the 'schema' element from an XML Schema
> schema to the 'xhtml:block' substitution group but XMLMind says this is
> not valid (not derived from the base type of the substitution group
> element's type). That type is 'xs:anyType' and so this is not possible.
>
> I've checked the schemas with Xerces--which doesn't complain.
>
> Also, I know this all works because it works for other target namespaces in
> other schemas. So, I believe this is something special about XML Schema's
> namespace.
>
I don't know which version of XXE/xsdvalid you are using. With V2.9, I
have another error message when I try to validate your modified
XMLSchema.xsd (xhtml.xsd and xml.xsd are OK):
For
---
<xs:element id="schema" name="schema" substitutionGroup="xhtml:block">
...
---
and:
---
<xs:element name="schema-fixed" substitutionGroup="xhtml:block"
type="xs:SchemaFixed"/>
---
I get:
---
substitution has been disallowed by element declaration "xhtml:block"
[cos-equiv-derived-ok-rec.1]
---
The bug comes from the fact that XXE/xsdvalid implements ``chameleon
block'' and ``chameleon final''. That is, XMLSchema.xsd starts with:
---
<xs:schema blockDefault="#all" elementFormDefault="qualified"
targetNamespace="http://www.w3.org/2001/XMLSchema"
version="1.0"
...
---
and unfortunately, xhtml.xsd imported by XMLSchema.xsd ``inherits'' this
blockDefault. In practice, this prevents the xhtml:block substitution
group from being used!
The workaround is to remove blockDefault="#all" from XMLSchema.xsd.
This bug will be fixed in V2.9 Patch 1.