XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: Relax NG question: extending an enumeration list?


Hi Folks,

I have found the answer to my question.  Here is the (correct) schema
that extends the enumeration list:

--------------------------------------------
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="choice">
        <choice>
            <value>green</value>
            <value>purple</value>
        </choice>
    </define>
</grammar>

The key is to use combine="choice" (not combine="interleave")

/Roger

 

-----Original Message-----
From: Costello, Roger L. 
Sent: Monday, May 05, 2008 10:18 AM
To: xml-dev@lists.xml.org
Subject: Relax NG question: extending an enumeration list?


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)?

Thanks.

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS