W
WilliamB
New RELAX NG user here. So let's say I have the following definitions
in my RELAX NG schema:
<define name="DefineElementA">
<element name="ElementA">
<interleave>
<optional>
<element name="ElementB">
<text/>
</element>
</optional>
<optional>
<element name="ElementC">
<text/>
</element>
</optional>
<optional>
<element name="ElementD">
<text/>
</element>
</optional>
</interleave>
</element>
</define>
<define name="DefineElementE">
<interleave>
<ref name="DefineElementA"/>
<optional>
<element name="ElementF">
<text/>
</element>
</optional>
</interleave>
</define>
I want the definition "DefineElementE" to reference the definition
"DefineElementA" like above, but I also want to change the referenced
definition in the context of "DefineElementE" so that element
"ElementD" is required. ElementE is sort of like a subclass of
ElementA: it inherits all of ElementA's child elements. Simply
duplicating ElementA's definition in ElementE and making ElementD
required would break inheritance. Is there another way?
William Beaumont
in my RELAX NG schema:
<define name="DefineElementA">
<element name="ElementA">
<interleave>
<optional>
<element name="ElementB">
<text/>
</element>
</optional>
<optional>
<element name="ElementC">
<text/>
</element>
</optional>
<optional>
<element name="ElementD">
<text/>
</element>
</optional>
</interleave>
</element>
</define>
<define name="DefineElementE">
<interleave>
<ref name="DefineElementA"/>
<optional>
<element name="ElementF">
<text/>
</element>
</optional>
</interleave>
</define>
I want the definition "DefineElementE" to reference the definition
"DefineElementA" like above, but I also want to change the referenced
definition in the context of "DefineElementE" so that element
"ElementD" is required. ElementE is sort of like a subclass of
ElementA: it inherits all of ElementA's child elements. Simply
duplicating ElementA's definition in ElementE and making ElementD
required would break inheritance. Is there another way?
William Beaumont