<rule>

Defines the named rule expansion of an XML grammar.

Syntax

<rule
    id = "identifier"
    scope = "{private | public}"
/>

Attributes

Attribute

Data Type

Required?

Default

Description

id

identifier

yes

NA

Identifier by which to reference this rule.

scope

"{private | public}"

no

private

Scope of the rule. Valid values:

  • private

  • public

Parents

<grammar>

Children

<example>, <item>, <one-of>, <ruleref>, <tag>, <token>

Example

<?xml version= "1.0"?> 
    <grammar xmlns="http://www.w3.org/2001/06/grammar" 
        xml:lang="en-GB" root="rule1"> 
        <rule id="rule1" scope="public">
            <one-of> 
                <item>irish</item> 
            </one-of> 
        </rule>
    </grammar>