Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - Relax NG question: extending an enumeration list? [Thread Next] Re: [xml-dev] Relax NG question: extending an enumeration list?To: "Costello, Roger L." <costello@-----.---> Date: 5/5/2008 4:11:00 PM Costello, Roger L. wrote:
> Hi Folks,
>
> Is there a way, in Relax NG, to extend an enumeration list?
>
> For example, here is a schema with an enumeration list:
>
> --------------------------------------------
> Color.rng
> --------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <grammar xmlns="http://relaxng.org/ns/structure/1.0">
> <start>
> <element name="Color">
> <ref name="ColorDefn" />
> </element>
> </start>
> <define name="ColorDefn">
> <choice>
> <value>white</value>
> <value>grey</value>
> <value>blue</value>
> </choice>
> </define>
> </grammar>
>
> I would like to create another schema that imports Color.rng and
> extends its enumeration list. Here is my (incorrect) attempt:
>
> --------------------------------------------
> Color-ext.rng
> --------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <grammar xmlns="http://relaxng.org/ns/structure/1.0">
>
> <include href="Color.rng" />
>
> <define name="ColorDefn" combine="interleave">
> <choice>
> <value>green</value>
> <value>purple</value>
> </choice>
> </define>
> </grammar>
>
> What is the correct way of doing it (if it's possible)? <define name="Month">
<a:documentation>
<html:p>Element </html:p>
</a:documentation>
<choice>
<value>Jan</value>
<value>Feb</value>
<value>Mar</value>
<value>Apr</value>
<value>May</value>
<value>Jun</value>
<value>Jul</value>
<value>Aug</value>
<value>Sep</value>
<value>Oct</value>
<value>Nov</value>
<value>Dec</value>
</choice>
</define>
Is my 'exampler'
HTH
regards
--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
