我在这里有一个情况,我是一个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