0
考慮下面的XML文檔:XSL:包裝所有的後代文本和元素?
<dialog>
<speech speaker="Robert">
<line>"Once more into the breach", he said.</line>
I can't believe him. I just <emphasis>can't</emphasis> believe him!
</speech>
</dialog>
我想嘗試和內speech
捕捉eveything不在一個line
已經和在line
包裹它,但是我需要沿捕捉任何其他元素與它(例如上面的示例中的emphasis
)。
我想達到的效果是:
<dialog>
<speech speaker="Robert">
<line>"Once more into the breach", he said.</line>
<line>I can't believe him. I just <emphasis>can't</emphasis> believe him!</line>
</speech>
</dialog>
我使用libxslt
和libxml
,所以我堅持使用XSLT 1.0。接近,在XSLT 1.0