(注)このページは、「InDesign用XMLファイルの用意」、「XMLファイルの配置場所と、ファイル命名規則」を通読したという仮定の下で書かれています。
"rec_001.xml"の見本となる書式を示します。
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE Root SYSTEM "file:///Users/(account_name)/Library/Application Support/Esther/esth_novel.dtd" [ <!ENTITY text_body SYSTEM "file:///Users/(account_name)/Documents/Esther/material/InDesign/text/peculiar/txt_file/rec_001.txt"> <!ENTITY metadata_body SYSTEM "file:///Users/(account_name)/Documents/Esther/material/InDesign/text/peculiar/txt_file/metadata.txt"> ]> <Root> &metadata_body; <!-- 実体宣言 --> <chapter chapter_id="(chapter_number)"> <header>(header_text)</header> <footer>(footer_text)</footer> <tab>(tab_text)</tab> <chapter_heading>(chapter_heading_text)</chapter_heading> <section section_id="(section_number)"> <section_heading>(section_heading)</section_heading> <paragraph paragraph_id="(paragraph_number)">&text_body;</paragraph> <!-- 実体宣言 --> <figure figure_id="(figure_number)" href="(figure_location)" figure_orientation="(figure_arientation)"></figure> </section> </chapter> </Root>
あくまで「見本」なので、このままコピーして使ったところで、意味がありません。
次の表で列挙する箇所*1を、適切な値に書き換える必要があります。*2
| account_name | ユーザのアカウント名 | |
| chapter_number | 章の番号(整数・半角英数) | |
| header_text | ヘッダに挿入される文字列 | |
| footer_text | フッタに挿入される文字列 | |
| ! | tab_text | タブに挿入される文字列 |
| chapter_heading_text | 章の題名 | |
| section_number | 節の番号(整数・半角英数) | |
| ! | section_heading | 節の題名 |
| ! | paragraph_number | 段落の番号(整数・半角英数) |
| ! | figure_number | 図版の番号(整数・半角英数) |
| ! | figure_location | 図版への絶対パス表記ファイル名 |
| ! | figure_arientation | 図版の方向 |
注意して頂きたい箇所は、"&"(アンパサンド)が記された*3部位です。これは実体宣言となっています。
XMLパーサによって、他のファイルに書かれているテキストが読み出されて組み込まれます。
パーサ解析時に挿入される部位の例を挙げれば、「著者名」や、「ヘッダに入る書名」、更には「文章の本文」そのものが該当します。
詰まり、それらはXMLファイルからは分離された、全く別のファイルとして作成しなくてはなりません。
因みに、ここで例に取った"rec_001.xml"の本文が保存されているのは、同じフォルダにある"rec_001.txt"という名前のファイルです。
無論、XMLファイルが複数個ある場合には、そのファイル名に呼応する形で
rec_001.txt
rec_002.txt
rec_003.txt
.
.
という名前で作成しておかなければなりません。
→ 「メタデータの記述」も参照のこと