| ENGLISH | JAPANESE |
| << | リラックスのしかた/第一部: RELAX Core/STEP 4: 注釈 | >> |
annotation要素です.annotation要素が入れられるのは,次の箇所です.interface要素の前に一個だけ
export要素の中に一個だけ
elementRule要素の最初の子として一個だけ
hedgeRule要素の最初の子として一個だけ
tag要素の最初の子として一個だけ
attPool要素の最初の子として一個だけ
attribute要素の最初の子として一個だけ
include要素の子要素として一個だけ
element要素の最初の子として一個だけ
div要素の最初の子として一個だけ
elementRule要素の最初の子として,注釈を使用した例を以下に示します.注釈の内容は省略しています.
<elementRule role="para">
<annotation> ... </annotation>
<mixed>
<ref label="fnote" occurs="*"/>
</mixed>
</elementRule>
|
annotation要素は,子要素としてdocumentationとappinfoをいくつでも持つことができます.
documentation要素です.RELAX Namespaceが制定されていない現時点は,テキストデータしか入れられません.documentationを付加したものを次に示します.
<elementRule role="para">
<annotation>
<documentation>This is a paragraph.</documentation>
</annotation>
<mixed>
<ref label="fnote" occurs="*"/>
</mixed>
</elementRule>
|
documentation要素がsource属性を持つ場合は,説明を参照するURIが属性値です.この場合は,documentation要素の内容は使われません.モジュールを表示するツールは,リンクを利用した表示を提供します.
<elementRule role="para">
<annotation>
<documentation source="http://www.xml.gr.jp/relax/"/>
</annotation>
<mixed>
<ref label="fnote" occurs="*"/>
</mixed>
</elementRule>
|
documentation要素にxml:lang属性が指定されたときは,documentation要素の内容が,どの自然言語で書かれているかを示します.
つぎの例では,xml:langの値として"en"が指定されています.
<elementRule role="para">
<annotation>
<documentation xml:lang="en">This is a paragraph.</documentation>
</annotation>
<mixed>
<ref label="fnote" occurs="*"/>
</mixed>
</elementRule>
|
appinfo要素です.RELAX Namespaceが制定されていない現時点は,テキストデータしか入れられません.
<elementRule role="foo" type="integer"> <annotation><appinfo>default:1</appinfo></annotation> </elementRule> |
appinfo要素がsource属性を持つ場合は,隠し情報を参照するURLが属性値です.この場合は,appinfo要素の内容は使われません.
elementRule, hedgeRule, tag, attPoolを一つにまとめて注釈をつけたいことがあります.そのために用意されているのがdiv要素です.div要素は,module要素の中に,elementRule, hedgeRule, tag, attPoolと同レベルに置きます.div要素の中にさらにdiv要素を置くこともできます.div要素の中には,elementRule, hedgeRule, tag,
attPool, divを置くことができます.divを使用して注釈を加えたものを下に示します.
<module
moduleVersion="1.2"
relaxCoreVersion="1.0"
targetNamespace=""
xmlns="http://www.xml.gr.jp/xmlns/relaxCore">
<interface>
<export label="doc"/>
</interface>
<div>
<annotation>
<documentation>The root node</documentation>
</annotation>
<elementRule role="doc">
<sequence>
<ref label="title"/>
<ref label="para" occurs="*"/>
</sequence>
</elementRule>
<tag name="doc"/>
</div>
<div>
<annotation>
<documentation>Paragraphs</documentation>
</annotation>
<elementRule role="para">
<mixed>
<ref label="em" occurs="*"/>
</mixed>
</elementRule>
<tag name="para">
<attribute name="class" type="NMTOKEN"/>
</tag>
</div>
<elementRule role="title">
<mixed>
<ref label="em" occurs="*"/>
</mixed>
</elementRule>
<tag name="title">
<attribute name="class" type="NMTOKEN"/>
<attribute name="number" required="true" type="integer"/>
</tag>
<elementRule role="em" type="string"/>
<tag name="em"/>
</module>
|
| << | リラックスのしかた/第一部: RELAX Core/STEP 4: 注釈 | >> |