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: 注釈 | >> |