Using MSXML with Navision 3.70

kaybee
Member Posts: 49
Basically I'm trying to make use of this automation.
I've installed MSXML6.dll on the Navision server itself and on the terminal servers for which users log onto. I've "regsvr32 msxml6.dll" on both servers. And I'm still getting this error:
[ Error ]
Not sure if I am coding this properly but here's the "Globals":
and here's the code:
I've installed MSXML6.dll on the Navision server itself and on the terminal servers for which users log onto. I've "regsvr32 msxml6.dll" on both servers. And I'm still getting this error:
[ Error ]
Not sure if I am coding this properly but here's the "Globals":
RootElement Automation 'Microsoft XML, v6.0'.IXMLDOMElement SubRootElement Automation 'Microsoft XML, v6.0'.IXMLDOMElement MemberElement Automation 'Microsoft XML, v6.0'.IXMLDOMElement XMLDom Automation 'Microsoft XML, v6.0'.DOMDocument
and here's the code:
CREATE(XMLDom); CREATE(RootElement); CREATE(SubRootElement); CREATE(MemberElement); XMLDom.loadXML('C:\Documents and Settings\kbc\Desktop\Work\Dev\Visual Basic\LabelMaker\LabelPrints\Labels.xml'); RootElement := XMLDom.documentElement; SubRootElement := XMLDom.createElement('label'); RootElement.appendChild(SubRootElement); MemberElement := XMLDom.createElement('value1'); SubRootElement.appendChild(MemberElement); MemberElement.text := 'KBC'; XMLDom.save('C:\Documents and Settings\kbc\Desktop\Work\Dev\Visual Basic\LabelMaker\LabelPrints\Labels.xml');
0
Comments
-
You have to use the create statement for xmlDom only, the other ones are created when assigned by ":=".
Hope this helps
Thomas0 -
ta5 wrote:You have to use the create statement for xmlDom only, the other ones are created when assigned by ":=".
Hope this helps
Thomas
Thanks, after rectifying the above, I keep getting an error on this line:RootElement.appendChild(SubRootElement);
This Automation variable has not been instantiated. You can instantiate it by either creating or assigning it.
I'm not familiar with this, is this something to do with the SubRootElement?0 -
Have a look to codeunit 6224, for example function AddElement. Then use this function directly if the license does allow it or make a copy of the function.
In 3.7 there are a lot of examples about using DOM in the BizTalk codeunits in the 890085xx-Range.
Don't hesitate to ask again if it doesnt work.
Hope this helps0 -
ta5 wrote:Have a look to codeunit 6224, for example function AddElement. Then use this function directly if the license does allow it or make a copy of the function.
In 3.7 there are a lot of examples about using DOM in the BizTalk codeunits in the 890085xx-Range.
Don't hesitate to ask again if it doesnt work.
Hope this helps
Unfortunately we don't have the license to view the codeunit 6224. And I can't see the other 890085 ones.
From the above code, can I not append nodes to the root? How should this be done properly?
I just want to be able to keep appending "<label>" to the root "<labels>". i.e.<?xml version="1.0" encoding="ISO-8859-1"?> <labels> <label></label> <label></label> <label></label> </labels>
0 -
Use this function (copy from cu6224) and adapt if for your needs.
AddElement(VAR XMLNode : Automation "'Microsoft XML, v3.0'.DOMDocument";NodeName : Text[250];NodeText : Text[250];NameSpace : Text[250] IF NOT NormalCaseMode THEN NodeName := UPPERCASE(NodeName); NewChildNode := XMLNode.ownerDocument.createNode('element', NodeName, NameSpace); IF ISCLEAR(NewChildNode) THEN BEGIN ExitStatus := 50; EXIT; END; IF NodeText <> '' THEN NewChildNode.text := NodeText; XMLNode.appendChild(NewChildNode); CreatedXMLNode := NewChildNode; ExitStatus := 0;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions