From IDMLWiki
10.2.5 TextVariable
テキスト変数とは、前後関係によって変化するテキストとして挿入するものです。例えば、テキスト変数「最終ページ番号」はそのドキュメントの最後のページのページ番号を表示します。ページの追加や削除をすると、変数が更新されます。IDMLドキュメントのテキスト変数は、<TextVariable>エレメントで設定します。テキスト変数には、次の種類のエレメントがあります。
- <CustomTextVariablePreference>
- <PageNumberVariablePreference>
- <chapterNumberVariablePreference>
- <DateVariablePreference>
- <MatchCharacterStylePreference>
- <MatchParagraphStylePreference>
テキスト変数の種類は<TextVariable>エレメントのVariableType属性で設定し、定義は子エレメントで行います。
<TextVariable>エレメントは<Document>エレメントに含まれ、テキスト変数の設定のみをします。テキスト変数インスタンスは<Story>エレメントに表れ、テキスト変数インスタンスの全ての形式は、<Document>エレメントではなく<Story>エレメントで定義されます。テキスト変数の詳細については、InDesignのオンラインヘルプを参照してください。
スキーマの例8 TextVariable
TextVariable_Object = element TextVariable { attribute Self { xsd:string }, attribute Name { xsd:string }, attribute VariableType { VariableTypes_EnumValue }?,(
CustomTextVariablePreference_Object?&
FileNameVariablePreference_Object?&
PageNumberVariablePreference_Object?&
ChapterNumberVariablePreference_Object?&
DateVariablePreference_Object?&
MatchCharacterStylePreference_Object?&
MatchParagraphStylePreference_Object?
)
}
表9 属性としてのTextVariableプロパティ
| 名前 |
値 |
必須 |
説明 |
| Name |
string |
|
テキスト変数の名前 |
| VariableType |
VariableTypes_EnumValue |
|
テキスト変数の種類。CustomTextType(カスタムテキスト)、FileNameType(ファイル名)、LastPageNumberType(最終ページ番号)、ChapterNumberType(章番号)、OutputDateType(出力日)、CreationDateType(作成日)、ModificationDateType(修正日)、MatchCharacterStyleType(ランニングヘッド・柱(文字スタイル))、MatchParagraphStyleType(ランニングヘッド・柱(段落スタイル)) |
| TextBefore |
string |
|
先行テキスト |
| TextAfter |
string |
|
後続テキスト |
スキーマの例9 CustomTextVariblePreference
CustomTextVariablePreference_Object = element CustomTextVariablePreference { attribute Self { xsd:string }, element Properties { element Contents { (string_type, xsd:string ) |
(enum_type, SpecialCharacters_EnumValue ) |
(object_type, xsd:string )
}?
}
?
}
表11 エレメントとしてのCustomTextVariablePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| Contents |
stringまたはSpecialCharacters_EnumValueまたはstring(Self属性への参照) |
|
テキストコンテンツ |
スキーマの例10 FileNameVariablePreference
FileNameVariablePreference_Object = element FileNameVariablePreference { attribute Self { xsd:string }, attribute TextBefore { xsd:string }?, attribute IncludePath { xsd:boolean }?, attribute IncludeExtension { xsd:boolean }?, attribute TextAfter { xsd:string }?}
表12 属性としてのFileNameVariablePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| IncludePath |
boolean |
|
trueのとき、テキスト変数インスタンスにファイルのパスを含む |
| IncludeExtension |
boolean |
|
trueのとき、テキスト変数インスタンスにファイルの拡張子を含む |
スキーマの例11 PageNumberVariblePreference
PageNumberVariablePreference_Object = element PageNumberVariablePreference { attribute Self { xsd:string }, attribute TextBefore { xsd:string }?, attribute Format { VariableNumberingStyles_EnumValue }?, attribute TextAfter { xsd:string }?, attribute Scope { VariableScopes_EnumValue }?}
表13 属性としてのPageNumberVariablePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| Format |
VariableNumberingStyles_EnumValue |
|
ページ番号。Current、Arabic、UpperRoman、LowerRoman、UpperLetters、LowerLetters、Kanji、FullWidthArabic、SingleLeadingZeros、DoubleLeadingZeros |
| Scope |
VariableScopes_EnumValue |
|
ページ番号の範囲。DocumentScopeかSectionScope |
スキーマの例12 ChapterNumberVariablePreference
ChapterNumberVariablePreference_Object = element ChapterNumberVariablePreference { attribute Self { xsd:string }, attribute TextBefore { xsd:string }?, attribute Format { VariableNumberingStyles_EnumValue }?, attribute TextAfter { xsd:string }?}
表14 属性としてのChapterNumberVariablePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| Format |
VariableNumberingStyles_EnumValue |
|
章番号形式。Current、Arabic、UpperRoman、LowerRoman、UpperLetters、LowerLetters、Kanji、FullWidthArabic、SingleLeadingZeros、DoubleLeadingZeros |
スキーマの例13 DetaVariablePreference
DateVariablePreference_Object = element DateVariablePreference{ attribute Self { xsd:string }, attribute TextBefore{ xsd:string }?, attribute Format { xsd:string }?, attribute TextAfter{ xsd:string }?}
表15 属性としてのDateVariablePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| Format |
string |
|
データ変数形式 |
スキーマの例14 MatchCharacterStylePreference
MatchCharacterStylePreference_Object = element MatchCharacterStylePreference{ attribute Self { xsd:string }, attribute TextBefore{ xsd:string }?, attribute TextAfter{ xsd:string }?, attribute AppliedCharacterStyle{ xsd:string }?, attribute SearchStrategy{ SearchStrategies_EnumValue }?, attribute ChangeCase{ ChangeCaseOptions_EnumValue }?, attribute DeleteEndPunctuation{ xsd:boolean }?}
表16 属性としてのMatchCharacterStylePreferenceプロパティ
| 名前 |
値 |
必須 |
説明 |
| AppliedCharacterStyle |
string |
|
テキスト変数に適用する文字スタイル(<CharacterStyle>エレメントのSelf属性の値) |
| ChangeCase |
ChageCaseOptions_EnumValue |
|
テキスト変数の大文字/小文字の変更。Uppercase、Lowercase、Titlecase、Sentencecase |
| DeleteEndPunctuation |
boolean |
|
trueのとき、テキスト変数のすべての区切り約物を削除する |
| SearchStrategy |
SearthStrategies_EnumValue |
|
テキスト変数に適用する文字スタイルの出現箇所。FirstOnPageかLastOnPage |
スキーマの例15 MatchParagraphStylePreference
MatchParagraphStylePreference_Object = element MatchParagraphStylePreference{ attribute Self { xsd:string }, attribute TextBefore{ xsd:string }?, attribute TextAfter{ xsd:string }?, attribute AppliedParagraphStyle{ xsd:string }?, attribute SearchStrategy{ SearchStrategies_EnumValue }?, attribute ChangeCase{ ChangeCaseOptions_EnumValue }?, attribute DeleteEndPunctuation{ xsd:boolean }?}
表17 属性としてのMatchParagraphStylePreference
| 名前 |
値 |
必須 |
説明 |
| AppliedParagraphStyle |
string |
|
テキスト変数へ適用する段落スタイル(<ParagraphStyle>エレメントのSelf属性の値) |
| ChangeCase |
ChageCaseOptions_EnumValue |
|
テキスト変数の大文字/小文字の変更。Uppercase、Lowercase、Titlecase、Sentencecase |
| DeleteEndPunctuation |
boolean |
|
trueのとき、テキスト変数のすべての区切り約物を削除する |
| SearchStrategy |
SearthStrategies_EnumValue |
|
テキスト変数に適用する段落スタイルの出現箇所。FirstOnPageかLastOnPage |
IDMLの例10 TextVariable
<TextVariable Self="dTextVariablenLast Page Number" Name="Last Page Number"
VariableType="LastPageNumberType">
<PageNumberVariablePreference
Self="dTextVariablenLast Page NumberPageNumberVariablePreference1"
TextBefore="" Format="Current" TextAfter="" Scope="SectionScope"/>
</TextVariable>