Forum Discussion
SmartBear_Suppo
Alumni
14 years agoHi Jo,
The addChildElement method you are using doesn't support namespaces unfortunately, you will have to add the elements "manually";
def parent = holder.getDomNode("//v1:Identifiers")
def doc = parent.ownerDocument
def ns = "http://xxxxxx.com/dsselect/ExtractionService/v1/"
// create main parent
def identifierChild = parent.appendChild( doc.createElementNS( ns , "InstrumentIdentifier" ))
// crate value
def valueChild = identifierChild.appendChild( doc.createElementNS( ns, "IdentifierValue" ))
valueChild.appendChild( doc.createTextNode( fields[1] ))
....
Hope this helps!
/Ole
SmartBear Software
The addChildElement method you are using doesn't support namespaces unfortunately, you will have to add the elements "manually";
def parent = holder.getDomNode("//v1:Identifiers")
def doc = parent.ownerDocument
def ns = "http://xxxxxx.com/dsselect/ExtractionService/v1/"
// create main parent
def identifierChild = parent.appendChild( doc.createElementNS( ns , "InstrumentIdentifier" ))
// crate value
def valueChild = identifierChild.appendChild( doc.createElementNS( ns, "IdentifierValue" ))
valueChild.appendChild( doc.createTextNode( fields[1] ))
....
Hope this helps!
/Ole
SmartBear Software