最初に、XML データを含むドキュメント オブジェクト モデル (DOM) ノードを作成することで、XML ファイルを書き込みます。次に、DOM ノードを XML ファイルに書き込みます。最終的な XML ファイルには次のテキストが含まれています。
<?xml version="1.0" encoding="utf-8"?>
<toc version="2.0">
<tocitem target="upslope_product_page.html">Upslope Area Toolbox<!-- Functions -->
<tocitem target="demFlow_help.html">demFlow</tocitem>
<tocitem target="facetFlow_help.html">facetFlow</tocitem>
<tocitem target="flowMatrix_help.html">flowMatrix</tocitem>
<tocitem target="pixelFlow_help.html">pixelFlow</tocitem>
</tocitem>
</toc>
最初に、DOM ノード オブジェクトとルート要素を作成し、その要素と XML データに対応するノードの属性を入力します。
ルート要素を特定し、version
属性を設定します。
tocitem
要素ノードを製品ページに追加します。このファイルの各 tocitem
要素には、target
属性と子テキスト ノードが設けられています。
コメントを追加します。
各関数に tocitem
要素ノードを追加します。ここで、target
は function
_help.html
の形式となります。
最後に、DOM ノードを infoUAT.xml
という名前の XML ファイルにエクスポートし、関数 type
を使用してファイルを表示します。
<?xml version="1.0" encoding="utf-8"?>
<toc version="2.0">
<tocitem target="upslope_product_page.html">Upslope Area Toolbox<!-- Functions --><tocitem target="demFlow_help.html">demFlow</tocitem>
<tocitem target="facetFlow_help.html">facetFlow</tocitem>
<tocitem target="flowMatrix_help.html">flowMatrix</tocitem>
<tocitem target="pixelFlow_help.html">pixelFlow</tocitem>
</tocitem>
</toc>