ディレクトリ リストから取得した情報を格納した XML ファイルを書き込もうとしていますが、createElement メソッドを動的コンテンツとうまく連携させる方法がわかりません。
動的テーブルのようにタグをハードコーディングしてから、出力全体を取得してxmlファイルに投稿するだけの誘惑に駆られますが、事前にフォーマットされたタグをxmlにドロップする方法もわかりません。
私のXMLはこのようにフォーマットする必要があります
<CONTENT>
<GALLERY name="**HARDCODED DATA**">
<CATEGORY name="**HARDCODED DATA BASED FROM DIRECTORY SEARCH 1**" desc="**HARDCODED DATA BASED FROM DIRECTORY SEARCH 1**" thumb="**HARDCODED DATA BASED FROM DIRECTORY SEARCH 1**">
<ITEM>
<file_path>**dynamic content from directory search**</file_path>
<file_width>**HARDCODED**</file_width>
<file_height>**HARDCODED**</file_height>
<file_title>**dynamic content from directory search**</file_title>
<file_desc>**Loaded from a seperate txt file, index to match with the index of the dir file**</file_desc>
<file_image>**Loaded from a seperate txt file, index to match with the index of the dir file**</file_image>
<featured_image>**Loaded from a seperate txt file, index to match with the index of the dir file**</featured_image>
<featured_or_not>**Loaded from a seperate txt file, index to match with the index of the dir file**</featured_or_not>
</ITEM>
****loop through for next ITEM****
</CATEGORY>
****start next category from secody directory search content****
</GALLERY>
****start gallery 2 and 3 here, same format at gallery 1****
</CONTENT>