我在這裏有一個情況,我是一個java的傢伙,並得到一些困難與php。 我正在從數據庫創建一個XML文件。目前,我創建了90多個動態元素,其中一些包括屬性,子元素等,沒有任何問題。 但事情搞砸了。是否有可能取代一個dom元素的子字符串
的text1: here is a list of pencils[1]. here is a list of another type of pencils[2].
我希望有
<text1>
here is a list of pencils <id>1</id>. here is a list of another type of pencils <id>2</id>.
</text1>
我可以代替子串([1],[2]),並插入一些其他文本,但如何用DOM元素替換這些子字符串?
任何幫助表示深深的感激..
你是如何構建XML文檔的?用XMLwriter,還是純粹的字符串連接? – mhitza 2012-02-18 14:46:43
嗨mhitza,謝謝你的回覆。我確實使用了xml編寫器。 – teutara 2012-02-18 14:50:38