Source

Fiction-XML / perl / modules / XML-Grammar-Fiction / extradata / screenplay-xml.rng

Full commit
<?xml version="1.0"?>
<!-- $Id: testSuite.rng,v 1.12 2003/01/29 12:24:07 jjc Exp $ -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
    xmlns:sp="http://web-cpan.berlios.de/modules/XML-Grammar-Screenplay/screenplay-xml-0.2/"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    >
    <start>
        <element name="sp:document">
            <element name="sp:head">
                <empty/>
            </element>
            <element name="sp:body">
                <attribute name="id">
                    <data type="ID"/>
                </attribute>
                <oneOrMore>
                    <ref name="scene" />
                </oneOrMore>
            </element>
        </element>
    </start>
    <define name="several_paras">
        <oneOrMore>
            <ref name="para"/>
        </oneOrMore>
    </define>
    <define name="single_inline_elem">
        <choice>
            <text/>
            <ref name="ulink"/>
            <ref name="bold"/>
            <ref name="italics"/>
        </choice>
    </define>
    <define name="scene">
        <element name="sp:scene">
            <attribute name="id">
                <data type="ID"/>
            </attribute>
            <optional>
                <attribute name="title">
                    <text/>
                </attribute>
            </optional>
            <zeroOrMore>
                <choice>
                    <element name="sp:description">
                        <ref name="several_paras"/>
                    </element>
                    <element name="sp:saying">
                        <attribute name="character">
                            <text/>
                        </attribute>
                        <ref name="several_paras"/>
                    </element>
                </choice>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="scene" />
            </zeroOrMore>
        </element>
    </define>
    <define name="para">
        <element name="sp:para">
            <zeroOrMore>
                <choice>
                    <text/>
                    <element name="sp:inlinedesc">
                        <zeroOrMore>
                            <ref name="single_inline_elem"/>
                        </zeroOrMore>
                    </element>
                    <ref name="single_inline_elem"/>
                    <element name="sp:br">
                        <empty/>
                    </element>
                </choice>
            </zeroOrMore>
        </element>
    </define>
    <define name="bold">
        <element name="sp:bold">
            <text />
        </element>
    </define>
    <define name="italics">
        <element name="sp:italics">
            <text />
        </element>
    </define>
    <define name="ulink">
        <element name="sp:ulink">
                <attribute name="url">
                    <text/>
                </attribute>
                <zeroOrMore>
                    <choice>
                        <text />
                        <ref name="bold"/>
                        <ref name="italics"/>
                    </choice>
            </zeroOrMore>
        </element>
    </define>
</grammar>