Translation:Text Variable

From IDMLWiki

Jump to: navigation, search

Contents

10.2.5 TextVariable

テキスト変数とは、前後関係によって変化するテキストとして挿入するものです。例えば、テキスト変数「最終ページ番号」はそのドキュメントの最後のページのページ番号を表示します。ページの追加や削除をすると、変数が更新されます。IDMLドキュメントのテキスト変数は、<TextVariable>エレメントで設定します。テキスト変数には、次の種類のエレメントがあります。

  • <CustomTextVariablePreference>
  • <PageNumberVariablePreference>
  • <chapterNumberVariablePreference>
  • <DateVariablePreference>
  • <MatchCharacterStylePreference>
  • <MatchParagraphStylePreference>

テキスト変数の種類は<TextVariable>エレメントのVariableType属性で設定し、定義は子エレメントで行います。

<TextVariable>エレメントは<Document>エレメントに含まれ、テキスト変数の設定のみをします。テキスト変数インスタンスは<Story>エレメントに表れ、テキスト変数インスタンスの全ての形式は、<Document>エレメントではなく<Story>エレメントで定義されます。テキスト変数の詳細については、InDesignのオンラインヘルプを参照してください。

スキーマの例8 TextVariable
  1. TextVariable_Object = element TextVariable {
  2.   attribute Self { xsd:string },
  3.   attribute Name { xsd:string },
  4.   attribute VariableType { VariableTypes_EnumValue }?,
  5. (
  6.   CustomTextVariablePreference_Object?&
  7.   FileNameVariablePreference_Object?&
  8.   PageNumberVariablePreference_Object?&
  9.   ChapterNumberVariablePreference_Object?&
  10.   DateVariablePreference_Object?&
  11.   MatchCharacterStylePreference_Object?&
  12.   MatchParagraphStylePreference_Object?
  13. )
  14. }
表9 属性としてのTextVariableプロパティ
名前 必須 説明
Name string テキスト変数の名前
VariableType VariableTypes_EnumValue テキスト変数の種類。CustomTextType(カスタムテキスト)、FileNameType(ファイル名)、LastPageNumberType(最終ページ番号)、ChapterNumberType(章番号)、OutputDateType(出力日)、CreationDateType(作成日)、ModificationDateType(修正日)、MatchCharacterStyleType(ランニングヘッド・柱(文字スタイル))、MatchParagraphStyleType(ランニングヘッド・柱(段落スタイル))
TextBefore string 先行テキスト
TextAfter string 後続テキスト
スキーマの例9 CustomTextVariblePreference
  1. CustomTextVariablePreference_Object = element CustomTextVariablePreference {
  2.   attribute Self { xsd:string },
  3.   element Properties {
  4.     element Contents {
  5.       (string_type, xsd:string ) |
  6.       (enum_type, SpecialCharacters_EnumValue ) |
  7.       (object_type, xsd:string )
  8.     }?
  9.   }
  10.   ?
  11. }
表11 エレメントとしてのCustomTextVariablePreferenceプロパティ
名前 必須 説明
Contents stringまたはSpecialCharacters_EnumValueまたはstring(Self属性への参照) テキストコンテンツ
スキーマの例10 FileNameVariablePreference
  1. FileNameVariablePreference_Object = element FileNameVariablePreference {
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore { xsd:string }?,
  4.   attribute IncludePath { xsd:boolean }?,
  5.   attribute IncludeExtension { xsd:boolean }?,
  6.   attribute TextAfter { xsd:string }?
  7. }
表12 属性としてのFileNameVariablePreferenceプロパティ
名前 必須 説明
IncludePath boolean trueのとき、テキスト変数インスタンスにファイルのパスを含む
IncludeExtension boolean trueのとき、テキスト変数インスタンスにファイルの拡張子を含む
スキーマの例11 PageNumberVariblePreference
  1. PageNumberVariablePreference_Object = element PageNumberVariablePreference {
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore { xsd:string }?,
  4.   attribute Format { VariableNumberingStyles_EnumValue }?,
  5.   attribute TextAfter { xsd:string }?,
  6.   attribute Scope { VariableScopes_EnumValue }?
  7. }
表13 属性としてのPageNumberVariablePreferenceプロパティ
名前 必須 説明
Format VariableNumberingStyles_EnumValue ページ番号。Current、Arabic、UpperRoman、LowerRoman、UpperLetters、LowerLetters、Kanji、FullWidthArabic、SingleLeadingZeros、DoubleLeadingZeros
Scope VariableScopes_EnumValue ページ番号の範囲。DocumentScopeかSectionScope
スキーマの例12 ChapterNumberVariablePreference
  1. ChapterNumberVariablePreference_Object = element ChapterNumberVariablePreference {
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore { xsd:string }?,
  4.   attribute Format { VariableNumberingStyles_EnumValue }?,
  5.   attribute TextAfter { xsd:string }?
  6. }
表14 属性としてのChapterNumberVariablePreferenceプロパティ
名前 必須 説明
Format VariableNumberingStyles_EnumValue 章番号形式。Current、Arabic、UpperRoman、LowerRoman、UpperLetters、LowerLetters、Kanji、FullWidthArabic、SingleLeadingZeros、DoubleLeadingZeros
スキーマの例13 DetaVariablePreference
  1. DateVariablePreference_Object = element DateVariablePreference{ 
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore{  xsd:string }?,
  4.   attribute Format { xsd:string }?,
  5.   attribute TextAfter{  xsd:string }?
  6. }
表15 属性としてのDateVariablePreferenceプロパティ
名前 必須 説明
Format string データ変数形式
スキーマの例14 MatchCharacterStylePreference
  1. MatchCharacterStylePreference_Object = element MatchCharacterStylePreference{ 
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore{  xsd:string }?,
  4.   attribute TextAfter{  xsd:string }?,
  5.   attribute AppliedCharacterStyle{  xsd:string }?,
  6.   attribute SearchStrategy{  SearchStrategies_EnumValue }?,
  7.   attribute ChangeCase{  ChangeCaseOptions_EnumValue }?,
  8.   attribute DeleteEndPunctuation{  xsd:boolean }?
  9. }
表16 属性としてのMatchCharacterStylePreferenceプロパティ
名前 必須 説明
AppliedCharacterStyle string テキスト変数に適用する文字スタイル(<CharacterStyle>エレメントのSelf属性の値)
ChangeCase ChageCaseOptions_EnumValue テキスト変数の大文字/小文字の変更。Uppercase、Lowercase、Titlecase、Sentencecase
DeleteEndPunctuation boolean trueのとき、テキスト変数のすべての区切り約物を削除する
SearchStrategy SearthStrategies_EnumValue テキスト変数に適用する文字スタイルの出現箇所。FirstOnPageかLastOnPage
スキーマの例15 MatchParagraphStylePreference
  1. MatchParagraphStylePreference_Object = element MatchParagraphStylePreference{ 
  2.   attribute Self { xsd:string },
  3.   attribute TextBefore{  xsd:string }?,
  4.   attribute TextAfter{  xsd:string }?,
  5.   attribute AppliedParagraphStyle{  xsd:string }?,
  6.   attribute SearchStrategy{  SearchStrategies_EnumValue }?,
  7.   attribute ChangeCase{  ChangeCaseOptions_EnumValue }?,
  8.   attribute DeleteEndPunctuation{  xsd:boolean }?
  9. }
表17 属性としてのMatchParagraphStylePreference
名前 必須 説明
AppliedParagraphStyle string テキスト変数へ適用する段落スタイル(<ParagraphStyle>エレメントのSelf属性の値)
ChangeCase ChageCaseOptions_EnumValue テキスト変数の大文字/小文字の変更。Uppercase、Lowercase、Titlecase、Sentencecase
DeleteEndPunctuation boolean trueのとき、テキスト変数のすべての区切り約物を削除する
SearchStrategy SearthStrategies_EnumValue テキスト変数に適用する段落スタイルの出現箇所。FirstOnPageかLastOnPage
IDMLの例10 TextVariable
  1. <TextVariable Self="dTextVariablenLast Page Number" Name="Last Page Number"
  2. VariableType="LastPageNumberType">
  3.     <PageNumberVariablePreference
  4.     Self="dTextVariablenLast Page NumberPageNumberVariablePreference1"
  5.     TextBefore="" Format="Current" TextAfter="" Scope="SectionScope"/>
  6. </TextVariable>
Personal tools