How do I reference a definition and at the same time modify it?

Discussion in 'XML' started by WilliamB, Jun 3, 2008.

  1. WilliamB

    WilliamB Guest

    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
     
    WilliamB, Jun 3, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shawn
    Replies:
    2
    Views:
    490
    =?Utf-8?B?RWx0b24gVw==?=
    Feb 19, 2006
  2. darrel
    Replies:
    2
    Views:
    599
    darrel
    Apr 5, 2006
  3. Krick
    Replies:
    1
    Views:
    1,990
    John C. Bollinger
    Aug 15, 2003
  4. sam pal
    Replies:
    3
    Views:
    754
    E. Robert Tisdale
    Jul 16, 2003
  5. rbt
    Replies:
    2
    Views:
    373
  6. flamesrock
    Replies:
    8
    Views:
    806
    Hendrik van Rooyen
    Nov 24, 2006
  7. Weng Tianxiang
    Replies:
    6
    Views:
    1,053
    Ray Andraka
    Mar 19, 2007
  8. Pierre Yves
    Replies:
    2
    Views:
    747
    Pierre Yves
    Jan 10, 2008
Loading...