2
添加新節點我有一個XML像下面,XSLT - 通過分析文本節點
<doc>
<chap>
The bowler delivers the ball
to the batsman who attempts to
hit the ball with his bat away from
the fielders so he can run to the
other end of the pitch and score a run.
</chap>
</doc>
我的要求是添加一個名爲<p>
到<chap>
文本節點,在添加<p>
節點到每個新行的新節點。
因此,所需的輸出,
<doc>
<chap>
<p>The bowler delivers the ball</p>
<p>to the batsman who attempts to</p>
<p>hit the ball with his bat away from</p>
<p>the fielders so he can run to the</p>
<p>other end of the pitch and score a run.</p>
</chap>
</doc>
你能給我一個建議,我該怎麼使用正則表達式爲此在XSLT和換行符(#xA
)與文本分離。
我試圖做這個任務,但想不到一種方法來做到這一點。
感謝您的解決方案。這工作完美。 +1 – sanjay