Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml document with xmlns=""

Status
Not open for further replies.

Binnen

Programmer
Nov 18, 2013
1
NL
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:pain.008.001.02">
<CstmrDrctDbtInitn xmlns="">
<GrpHdr>

The Node <Document> is created with the namespaceURI "urn:uso:std:iso:20022:tech:xsd:pain.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:pain.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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top