0

我需要在 PHP 中创建一个带有 Pasca Casing 样式的 XML 文件,但是当我创建例如属性时:CustomerType 现在保存 xml 输出字符串将CustomerType 转换为 customertype。

$dom = new DOMDocument('1.0', 'utf-8');
...
$element->setAttribute('CustomerType', "PROSPECT");
...
$dom->saveXML();

输出这个:

<cfdi:customer customertype="PROSPECT">
</cfdi:customer >

我需要我的输出:

<cfdi:Customer CustomerType="PROSPECT" />

因为客户没有没有价值,所以你更喜欢消除关闭节点标签

</cfdi:Customer >

为了这/>.

有没有办法在 php 代码库中配置它或在 php 对象中设置参数?

我会感谢你的回应。提前致谢!!!

4

0 回答 0