开发者

PHP DOM and single quotes

开发者 https://www.devze.com 2023-02-20 17:47 出处:网络
Is there 开发者_运维百科any way to tell DOMDocument to use single quotes instead of double quotes for attributes?No. DOMDocument is a data-oriented access API for XML. And it serializes the documents

Is there 开发者_运维百科any way to tell DOMDocument to use single quotes instead of double quotes for attributes?


No. DOMDocument is a data-oriented access API for XML. And it serializes the documents however it wants to.

There is no ->save() flag http://www.php.net/manual/en/libxml.constants.php in PHP to accomplish it. And other language bindings don't allow it either: Can nokogiri use single quotes for attributes on saving xml?
And this is because libxml itself does provide no means to override this. libxml2/xmlsave.h and others mention no quote-style flags. So, I'm afraid you're really out of luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消