Dom\HTMLDocument::saveXml
(PHP 8 >= 8.4.0)
Dom\HTMLDocument::saveXml — Serializes the document as an XML string
说明
Serializes the document as an XML string.
参数
node
- The node to serialize. If not provided, the entire document is serialized.
options
-
Additional Options.
The
LIBXML_NOEMPTYTAG
andLIBXML_NOXMLDECL
options are supported. Prior to PHP 8.3.0, only theLIBXML_NOEMPTYTAG
option is supported.
返回值
The serialized XML document string in the current
document encoding, or false
on failure.
错误/异常
-
Throws a Dom\DOMException with code
Dom\WRONG_DOCUMENT_ERR
ifnode
is from another document.
参见
- Dom\HTMLDocument::saveXmlFile() - Serializes the document as an XML file
- Dom\XMLDocument::saveHtml()
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/dom-htmldocument.savexml.php