Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How do I reference a definition and at the same time modify it?

Reply
Thread Tools

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

 
 
WilliamB
Guest
Posts: n/a
 
      06-03-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
Use of both positive reference and negative reference of the same signal for Xilinx chips would cause additional LUT delay? Weng Tianxiang VHDL 6 03-19-2007 04:58 PM
os.stat access and modify time same on WinXP rbt Python 2 03-23-2005 07:05 PM
can a class definition inside another class's definition Jianli Shen C++ 1 03-13-2005 06:02 PM



Advertisments