次のような構造の HTML ドキュメントがあります。
<li class="indent1">(something)
<li class="indent2">(something else)</li>
<li class="indent2">(something else)
<li class="indent3">(another sublevel)</li>
</li>
<li class="indent2">(something else)</li>
</li>
私がする必要があるのは、これらの LI タグを OL タグでラップすることです。ドキュメント全体に、このようなリストが多数あります。HTML は次のようにする必要があります。
<ol>
<li>(something)
<ol>
<li>(something else)</li>
<li>(something else)
<ol>
<li>(another sublevel)</li>
</ol>
</li>
<li>(something else)</li>
</ol>
</li>
</ol>
ノコギリでこれを行うにはどうすればよいですか?よろしくお願いします。
編集:
元のドキュメントにある HTML の例を次に示します。私のスクリプトは、すべての P タグを LI タグに変換しました。
<p class="indent1"><i>a.</i> This regulation describes the Army Planning, Programming,
Budgeting, and Execution System (PPBES). It explains how an integrated Secretariat and
Army Staff, with the full participation of major Army commands (MACOMs), Program
Executive Offices (PEOs), and other operating agencies--</p>
<p class="indent2">(1) Plan, program, budget, and then allocate and manage approved
resources.</p>
<p class="indent2">(2) Provide the commanders in chief (CINCs) of United States unified
and specified commands with the best mix of Army forces, equipment, and support
attainable within available resources.</p>
<p class="indent1"><i>b.</i> The regulation assigns responsibilities and describes
policy and procedures for using the PPBES to:</p>
インデント 1 クラスは第 1 レベルのリスト項目を意味し、インデント 2 は第 2 レベルを意味します。これらのインデント クラスを適切な順序付きリストに変換する必要があります。