[Home] [By Thread] [By Date] [Recent Entries]

  • From: Michael Sokolov <msokolov@s...>
  • To: Maik St��nberg<maik.stuehrenberg@u...>
  • Date: Wed, 22 Jan 2014 14:14:03 -0500

Thanks Maik - I don't think that works since we want to require the presence of the all collection?

On 01/22/2014 01:00 PM, Maik Stührenberg wrote:
As a follow up, this may work for you:

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
    <start>
        <element name="root">
            <oneOrMore>
                <choice>
                    <element name="collection">
                        <value>all</value>
                    </element>
                    <zeroOrMore>
                        <element name="collection">
                            <text/>
                        </element>
                    </zeroOrMore>
                    <zeroOrMore>
                        <text/>
                    </zeroOrMore>
                </choice>
            </oneOrMore>
        </element>
    </start>
</grammar>

Best,

Maik


2014/1/22 Maik Stührenberg <maik.stuehrenberg@u...>
Hi Mike,

as far as I can see, there is no way to define this in RNG, since the same element or pattern cannot appear more than once in an interleave (see http://books.xmlschemata.org/relaxng/relax-CHP-6-SECT-9.html).
With choice it wouldn't be a problem (if I've understood your question correctly):

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
    <start>
        <element name="root">
            <choice>
                <element name="collection">
                    <value>all</value>
                </element>
                <zeroOrMore>
                    <element name="collection">
                        <text/>
                    </element>
                </zeroOrMore>
            </choice>
        </element>
    </start>
</grammar>

Best,

Maik



2014/1/22 Michael Sokolov <msokolov@s...>
I have a schema that allows a bunch of different elements to be interleaved in any order; one of them is <collection>;  I want to require that a collection with value "all" be present, as well as allowing any number of other collections, in any order, using RELAX -- is that possible?  I can't seem to work out how, if it is.  For now I'm just using

element collection { text }+ &

Thanks

-Mike

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



--
Dr. Maik Stührenberg

Universität Bielefeld
Fakultät für Linguistik und Literaturwissenschaft
Universitätsstraße 25
33615 Bielefeld

Telefon: +49 (0)521/106-2534
E-Mail: maik.stuehrenberg@u...

http://www.maik-stuehrenberg.de
http://www.xstandoff.net



--
Dr. Maik Stührenberg

Universität Bielefeld
Fakultät für Linguistik und Literaturwissenschaft
Universitätsstraße 25
33615 Bielefeld

Telefon: +49 (0)521/106-2534
E-Mail: maik.stuehrenberg@u...

http://www.maik-stuehrenberg.de
http://www.xstandoff.net



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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member