

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# ルール参照
<a name="srgs-rule-reference"></a>

次の表は、文法ドキュメント内で考えられるさまざまな形式のルール参照をまとめたものです。詳細については、*音声認識文法仕様バージョン 1* W3C レコメンデーションの「[ルール参照](https://www.w3.org/TR/speech-grammar/#S2.2)」を参照してください。


| 参照タイプ | XML フォーム | サポート | 
| --- | --- | --- | 
| [ 2.2.1 ](https://www.w3.org/TR/speech-grammar/#S2.2.1) 明示的なローカルルール参照 | <ruleref uri="\$1rulename"/> | はい | 
| [ 2.2.2 ](https://www.w3.org/TR/speech-grammar/#S2.2.2) [URI](https://www.w3.org/TR/speech-grammar/#term-uri) で識別される文法の名前付きルールへの明示的な参照 | <ruleref uri="grammarURI\$1rulename"/> | いいえ | 
| [ 2.2.2 ](https://www.w3.org/TR/speech-grammar/#S2.2.2) [URI](https://www.w3.org/TR/speech-grammar/#term-uri) で識別される文法のルートルールへの暗示的な参照 | <ruleref uri="grammarURI"/> | いいえ | 
| [ 2.2.2 ](https://www.w3.org/TR/speech-grammar/#S2.2.2) [メディアタイプ](https://www.w3.org/TR/speech-grammar/#term-media-type)を持つ [URI](https://www.w3.org/TR/speech-grammar/#term-uri) で識別される文法の名前付きルールへの明示的な参照 | <ruleref uri="grammarURI\$1rulename" type="media-type"/> | いいえ | 
| [ 2.2.2 ](https://www.w3.org/TR/speech-grammar/#S2.2.2) [メディアタイプ](https://www.w3.org/TR/speech-grammar/#term-media-type)を持つ [URI](https://www.w3.org/TR/speech-grammar/#term-uri) で識別される文法のルートルールへの暗示的な参照 | <ruleref uri="grammarURI" type="media-type"/> | いいえ | 
| [2.2.3](https://www.w3.org/TR/speech-grammar/#S2.2.3) 特殊ルールの定義 | `<ruleref special="NULL"/>` `<ruleref special="VOID"/>` `<ruleref special="GARBAGE"/>` | いいえ | 

**Notes** (メモ)

1. 文法 URI は外部 URI です。例えば、`http://grammar.example.com/world-cities.grxml`。

1. メディアタイプには以下のものがあります。
   + `application/srgs+xml`
   + `text/plain`

**例**

```
<rule id="city" scope="public">
    <one-of>
        <item>Boston</item>
        <item>Philadelphia</item>
        <item>Fargo</item>
    </one-of>
</rule>

<rule id="state" scope="public">
    <one-of>
        <item>FL</item>
        <item>MA</item>
        <item>NY</item>
    </one-of>
</rule>

<!-- "Boston MA" -> city = Boston, state = MA -->
<rule id="city_state" scope="public">
    <ruleref uri="#city"/> <ruleref uri="#state"/>
</rule>
```