XML help please

Hey guys, I’m struggling with some XML. Is there a way to import an xml structure and rename some of the node names? here is a little example of what Im trying to achieve: From: <ApplicationMessage> <OINP> <BasicOrderDetails> <OrderReference/> <EMXProviderId/> <ClientReference/> </OINP> </ApplicationMessage> TO: <ApplicationMessage> <TBKD> <BasicOrderDetails> <OrderReference/> <EMXProviderId/> <ClientReference/> </TBKD> </ApplicationMessage> You can see I’m trying to rename the OINP to TBKD. Please help!

Alex, XML file manipulation in C\SIDE is done using the microsoft DOM parser declared as an automation variable. There is a example of using this in Navision codeunits 6224 to 6226. There are also loads of web resources describing the methods and properties of the varrious DOM parser objects. The only limitation I have found using it in Navision is that the C\SIDE string buffer size (1024 character) limits the length of text you can use to create node or attribute values. I was trying to write out order comments at the time abd was trying to append all the seperate navision comment lines to one xml node. Chris.

Thanks Chris, I’m using the DOM automations and can construct XML messages. I had looked through some documentation but could not find a way to import an XML message change the name (not value) of some of the nodes and resave with the new changes. I was trying to use this: XMLCurrNode.nodeName := ‘newname’ where XMLCurrNode is a ‘Microsoft XML, v2.6’.IXMLDOMNode automation Any suggestions on which Method or Property to use?

this doesn’t seems to be as easy as it sounds … you need to crate a new node with the attributes and childs of the old node … have a look here: http://javaalmanac.com/egs/org.w3c.dom/SetElemName.html

Thats just what I needed, thanks man.

… or use transformNode to transform the XML document by using a XSL Stylesheet.