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