Lists Home |
Date Index |
1. <include> should be <import> if the namespaces are different for the
2. B must import A, as you say.
3. A does not need to import B. Element A must be declared as the head of
a substitution group. I think some or all uses of the A element in complex
types must be marked as allowing substitutions. The instance documents
specified by the schema for A, in which element B is substituted for element
A should be parsed in an environment in which schema locations can be found
for both A and B.
Substitution groups would have been DOA as a practical concept if the
namespace of the head of the group had to incorporate by import the
namespaces of all possible substitutions. One of the purposes of this was
for umbrella organizations or consortia to be able to declare abstract
(never-instantiated) elements of possibly abstract type and let others
provide all the instantiable derived types and substitute elements.
----- Original Message -----
From: "Paul Spencer" <email@example.com>
To: "Xml-Dev" <firstname.lastname@example.org>
Sent: Friday, February 18, 2005 2:00 AM
Subject: [xml-dev] Substitution Groups
> Are substitution groups practical when the head of the group is in a
> different schema document from the members of the group? The scenario is
> File A defines a complex data type AType and an element A of that type.
> File B defines a complex type BType that is an extension of AType and an
> element B of that type. Element B is in the substitution group for element
> It as an error if File B does not <include> file A since the XML Processor
> can't find the head of the substitution group.
> File A must <include> file B otherwise an instance that uses element B
> be invalid.
> However, if I have the circular <include> (file A <include>s file B and
> B <include>s file A) as some published examples do, MSXML is unhappy
> it sees multiple definitions.
> Am I being really stupid here? I'll probably realise as soon as I post
> Paul Spencer
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>