さて、ここでの私の質問に続きます。
私のページが次のようになっているとしましょう。
A.xml:
<page>
<header>Page A</header>
<content-a>Random content for page A</content-a>
<content-b>More of page A's content</content-b>
<content-c>More of page A's content</content-c>
<!-- This doesn't keep going: there are a predefined number of sections -->
</page>
B.xml:
<page include="A.xml">
<header>Page B</header>
<content-a>Random content for page B</content-a>
<content-b>More of page B's content</content-b>
<content-c>More of page B's content</content-c>
</page>
C.xml:
<page include="B.xml">
<header>Page C</header>
<content-a>Random content for page C</content-a>
<content-b>More of page C's content</content-b>
<content-c>More of page C's content</content-c>
</page>
変換後(on C.xml
)、私はこれで終わりたいと思います:
<h1>Page C</h1>
<div>
<p>Random content for page C</p>
<p>Random content for page B</p>
<p>Random content for page A</p>
</div>
<div>
<p>More of page C's content</p>
<p>More of page B's content</p>
<p>More of page A's content</p>
</div>
<div>
<p>Yet more of page C's content</p>
<p>Yet more of page B's content</p>
<p>Yet more of page A's content</p>
</div>
document(@include)
別のドキュメントを含めるために使用できることを知っています。ただし、再帰は私を少し超えています。
このような変換をどのように記述しますか?