thread796-1710167
Hello,
For those who work on an XML with xmlns="" this could help fix it.
EXAMPLE:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns:xsi=" xmlns="urn:uso:std:iso:20022:tech:xsd
ain.008.001.02">
<CstmrDrctDbtInitn xmlns="">
<GrpHdr>
The Node <Document> is created with the namespaceURI "urn:uso:std:iso:20022:tech:xsd
ain.008.001.02" while the next one <CstmrDrctDbtInitn xmlns=""> has no namespaceURI !!!
SOLUTION:
The solution is using the same namespaceURI per node/element
So I create a node like:
Constr cNameSpaceURI AS STring = = "urn:uso:std:iso:20022:tech:xsd
ain.008.001.02"
Dim CstmrDrctDbtInitn AS IXMLDOMNode
DIm Curr_att AS IXMLDOMAttribute
Set CstmrDrctDbtInitn = dom.createNode(NODE_ELEMENT, "CstmrDrctDbtInitn", cNameSpaceURI )
or like
Set Curr_att = dom.CreateNode(NODE_ATTRIBUTE, "Ccy", cNameSpaceURI )
Curr_att .NodeValue = "EUR"
IstrAmt_node.Attributes.SetNamedItem Curr_att
I hope this can help others.
Hello,
For those who work on an XML with xmlns="" this could help fix it.
EXAMPLE:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns:xsi=" xmlns="urn:uso:std:iso:20022:tech:xsd
<CstmrDrctDbtInitn xmlns="">
<GrpHdr>
The Node <Document> is created with the namespaceURI "urn:uso:std:iso:20022:tech:xsd
SOLUTION:
The solution is using the same namespaceURI per node/element
So I create a node like:
Constr cNameSpaceURI AS STring = = "urn:uso:std:iso:20022:tech:xsd
Dim CstmrDrctDbtInitn AS IXMLDOMNode
DIm Curr_att AS IXMLDOMAttribute
Set CstmrDrctDbtInitn = dom.createNode(NODE_ELEMENT, "CstmrDrctDbtInitn", cNameSpaceURI )
or like
Set Curr_att = dom.CreateNode(NODE_ATTRIBUTE, "Ccy", cNameSpaceURI )
Curr_att .NodeValue = "EUR"
IstrAmt_node.Attributes.SetNamedItem Curr_att
I hope this can help others.