1
如何獲取XML的內容作爲字符串? 我有這樣一個xml:PHP獲取XML rootNode內容爲字符串
<?xml version="1.0" encoding="utf-8"?>
<section>
<paragraph>some content</paragraph>
<custom>some more content</custom>
</section>
,我想部分的內容,像這樣的字符串:
<paragraph>some content</paragraph>
<custom>some more content</custom>
每個文檔我讀到目前爲止只介紹瞭如何獲取的內容子節點但不是根節點。
好吧,我不得不重複槽的childNodes,我希望有實現的一些方法一次獲取內容。 thx – Camel
嗨駱駝。感謝您接受我的回答。我認爲沒有迭代就沒有這樣的方式。看看https://stackoverflow.com/questions/2087103/how-to-get-innerhtml-of-domnode – Dorad