(no subject)

Steve Drach <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <Pine.GSO.4.50.0401091208210.2341-100000@sml-xhost>
I'm trying to define an attribute that can have a list of one or more (up
to three) mutually exclusive values.  For example, all the following are
valid:

<test state="hide"/>
<test state="hide enable"/>
<test state="hide enable lower"/>
<test state="show raise"/>
<test state="raise show"/>

But these are not valid:

<test state="hide show"/>
<test state="hide enable disable"/>
<test state="hide enable show"/>

So, I tried to specify the element and attribute as follows:

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <ref name="test"/>
  </start>
  <define name="test">
    <element name="TEST">
      <attribute name="state">
        <interleave>
          <choice>
            <value>hide</value>
            <value>show</value>
          </choice>
          <choice>
            <value>enable</value>
            <value>disable</value>
          </choice>
          <choice>
            <value>raise</value>
            <value>lower</value>
          </choice>
        </interleave>
      </attribute>
    </element>
  </define>
</grammar>

However, when I run jing on this to verify it, I get the following
message:

test.rng:8:31: error: interleave of "string" or "data" element

I'm not quite sure what I'm doing wrong here.  Hopefully someone
will educate me.  Secondly, since this is wrong, is there a way
to correctly specify this?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.