如何在xml对象(PHP)上添加前缀和URI

如何在xml对象(PHP)上添加前缀和URI,php,xml,namespaces,uri,prefix,Php,Xml,Namespaces,Uri,Prefix,在这个样本中,我们发现: 我们从头创建一个xml对象。好的。 我的问题是,在构建对象的过程中,如何在标记中嵌入前缀 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:/

在这个样本中,我们发现:


我们从头创建一个xml对象。好的。 我的问题是,在构建对象的过程中,如何在标记中嵌入前缀

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header />
    <soapenv:Body>
        <EnviarLoteRpsEnvio xmlns="http://www.betha.com.br/e-nota-contribuinte-ws">
                           ...some important xml...
        </EnviarLoteRpsEnvio>
    </soapenv:Body>
</soapenv:Envelope>

…一些重要的xml。。。
在上面的代码中,显示最后一个xml,在创建xml对象的过程中,如何将前缀嵌入标记中?对不起,我的英语有问题。。
谢谢您的帮助。

您可能希望使用扩展,而不是手动创建XML。对。。我试图通过soap发送,但是,我想与我的系统集成的Web服务,等待一个对象作为参数,然后我相信这是唯一的方法。
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header />
    <soapenv:Body>
        <EnviarLoteRpsEnvio xmlns="http://www.betha.com.br/e-nota-contribuinte-ws">
                           ...some important xml...
        </EnviarLoteRpsEnvio>
    </soapenv:Body>
</soapenv:Envelope>