【发布时间】:2011-03-29 13:43:45
【问题描述】:
有没有办法告诉 DOMDocument 对属性使用单引号而不是双引号?
【问题讨论】:
有没有办法告诉 DOMDocument 对属性使用单引号而不是双引号?
【问题讨论】:
没有。 DOMDocument 是一个面向数据的 XML 访问 API。并且它可以随意序列化文档。
PHP 中没有 ->save() 标志 http://www.php.net/manual/en/libxml.constants.php 来完成它。其他语言绑定也不允许:Can nokogiri use single quotes for attributes on saving xml?
这是因为 libxml 本身并没有提供任何方法来覆盖它。 libxml2/xmlsave.h 和其他人没有提到引用样式的标志。所以,恐怕你真的不走运。
【讨论】: