INCLUIR ENCODING NO XML USANDO DOM
Prezados Colegas,
Alguem sabe me dizer a propriedade do objeto dom que devo usar para incluir:
<?xml version=[Ô]1.0[Ô] encoding=[Ô]utf-8[Ô]?>
Já tentei isso mas nao obtive sucesso:
Dim dom As DOMDocument
Dim nfe As IXMLDOMElement
Set dom = new domdocument
Set nfe = dom.createElement([Ô]NFe[Ô])
nfe.setAttribute [Ô]xmlns[Ô], [Ô]http://www.portalfiscal.inf.br/nfe[Ô]
dom.appendChild nfe
dom.createProcessingInstruction [Ô]xml[Ô], [Ô]version=[ô]1.0[ô] encoding=[ô]UTF-8[ô][Ô]
dom.save [Ô]C:
fe.xml[Ô]
Alguem sabe me dizer a propriedade do objeto dom que devo usar para incluir:
<?xml version=[Ô]1.0[Ô] encoding=[Ô]utf-8[Ô]?>
Já tentei isso mas nao obtive sucesso:
Dim dom As DOMDocument
Dim nfe As IXMLDOMElement
Set dom = new domdocument
Set nfe = dom.createElement([Ô]NFe[Ô])
nfe.setAttribute [Ô]xmlns[Ô], [Ô]http://www.portalfiscal.inf.br/nfe[Ô]
dom.appendChild nfe
dom.createProcessingInstruction [Ô]xml[Ô], [Ô]version=[ô]1.0[ô] encoding=[ô]UTF-8[ô][Ô]
dom.save [Ô]C:
fe.xml[Ô]
Achei na web, vai a dica...
Dim xmlProcessingInstruction As MSXML2.IXMLDOMProcessingInstruction
Set xmlProcessingInstruction = objDoc.createProcessingInstruction([Ô]xml[Ô], [Ô]version=[ô]1.0[ô] encoding=[ô]UTF-8[ô][Ô])
objDoc.appendChild xmlProcessingInstruction
Set xmlProcessingInstruction = Nothing
Dim xmlProcessingInstruction As MSXML2.IXMLDOMProcessingInstruction
Set xmlProcessingInstruction = objDoc.createProcessingInstruction([Ô]xml[Ô], [Ô]version=[ô]1.0[ô] encoding=[ô]UTF-8[ô][Ô])
objDoc.appendChild xmlProcessingInstruction
Set xmlProcessingInstruction = Nothing
Tópico encerrado , respostas não são mais permitidas