次の内容が与えられます:
<div class="content">
<div id="brian">
<p>Hello my name is Alex</p>
<p>My surname is Thomas</p>
<p>My middle name is James</p>
<p>true story...</p>
</div>
</div>
そして、私のテーマには次のようなものがあります。
<div id="dave" />
#dave
どのように私は最初の段落に置き換えますか?私はもう試した:
<replace content="//div[@class='content']/p" theme="div#dave" />
<replace content="//div[@class='content']/p[1]" theme="div#dave" />
<replace content="children://div[@class='content']/p" theme="meta#description" />
どちらも機能しませんでした....content
かなり深く埋まっていて位置が変わる可能性があるため、XPathを使用することはできません。xPathとは、/div/div/p[1]
などを意味します。