IXMLDOMParseError

DonSchillo
Member Posts: 8
Hello everyone,
I'm new in this forum and I hope I can explain my problem properly. I have created a XMLPort to import XMLdata in a table. THe XMLport is called by a function in the table. In some cases the MS XML Parser reports an error in several files when i just start the XMLport by XMLPORT.IMPORT(50999,l_DMSBelegInStream).
In order to not interupt the loop which imports and xcopies the files, I used an IF statement [IF XMLPORT.IMPORT(50999,l_DMSBelegInStream)THEN BEGIN]. That works pretty fine. The problem is that I cannot see anymore which error occured for the files not imported and left in the folder.
Therfore I tried to use the IXMLDOMParseError which I'm not familiar with.
-I declared it as an Automation variable of type 'Microsoft XML, v4.0'.IXMLDOMParseError'
-I created an instance of it before my loop with a CREATE statement
-I added the following code within the loop
IF XMLParser.errorCode <> 0 THEN BEGIN
MESSAGE('Error validating XML file: \'
+ XMLParser.reason
+ '\Line: ' + FORMAT(XMLParser.line) +' ' );
END;
The compiler reports no error but when I start the import, I get an error saying:
"This message is for C/AL programmers:
Could not greate an instance of the ole control or Automation server identified by GUID={F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{3EFAA426-272F-11D2-836F-0000F87A7782}: 'Microsoft XML,v4.0' IXMLDOMParseError. Check that the OLE control or Automation server is correctly installed and registered."
Can anyone tell me which ocx or dll contains this Automation Server an who I have to install an register ist. I tried it with the msxml4.dll but it didn't work.
Thanks for your replys.
I'm new in this forum and I hope I can explain my problem properly. I have created a XMLPort to import XMLdata in a table. THe XMLport is called by a function in the table. In some cases the MS XML Parser reports an error in several files when i just start the XMLport by XMLPORT.IMPORT(50999,l_DMSBelegInStream).
In order to not interupt the loop which imports and xcopies the files, I used an IF statement [IF XMLPORT.IMPORT(50999,l_DMSBelegInStream)THEN BEGIN]. That works pretty fine. The problem is that I cannot see anymore which error occured for the files not imported and left in the folder.
Therfore I tried to use the IXMLDOMParseError which I'm not familiar with.
-I declared it as an Automation variable of type 'Microsoft XML, v4.0'.IXMLDOMParseError'
-I created an instance of it before my loop with a CREATE statement
-I added the following code within the loop
IF XMLParser.errorCode <> 0 THEN BEGIN
MESSAGE('Error validating XML file: \'
+ XMLParser.reason
+ '\Line: ' + FORMAT(XMLParser.line) +' ' );
END;
The compiler reports no error but when I start the import, I get an error saying:
"This message is for C/AL programmers:
Could not greate an instance of the ole control or Automation server identified by GUID={F5078F18-C551-11D3-89B9-0000F81FE221} 4.0:{3EFAA426-272F-11D2-836F-0000F87A7782}: 'Microsoft XML,v4.0' IXMLDOMParseError. Check that the OLE control or Automation server is correctly installed and registered."
Can anyone tell me which ocx or dll contains this Automation Server an who I have to install an register ist. I tried it with the msxml4.dll but it didn't work.
Thanks for your replys.
0
Comments
-
Try this:
You first open the xmlDoc with the load method, then initalize the xmlParseError assigning it to the xmlDoc.parseError-Property.CREATE(xmlDoc); xmlDoc.load(FilePath + FileName); xmlParseError := xmlDoc.parseError; IF xmlParseError.errorCode <> 0 THEN ..
Hope this helps
Thomas0 -
Hello ta5,
thank you for your reply. Unfortunatelly it didn't work. The error message still occurs. It's nearly the same. Only the GUID has changed. It seems to me that all these methods must be reristered somewhere by an ocx or dll. But I don't know which ocx or dll and where to register it.0 -
1) Do you have a partner license (are you a solution center)?
2) When you create a new variable of automation type, can you select this 'Microsoft XML, v4.0'.IXMLDOMDocument40?
If not, then the DLL's are not registered.0 -
1) Yes I'm from a Solution Center and we have a Partner license
2) Yes I can select this 'Microsoft XML, v4.0'.IXMLDOMDocument40 when I create a new variable0 -
One thing to check when working with XML files and checking properties is the Async flag. It is possible that the file may not be completely loaded when you are trying to check the PageError property.
You may want to set the ASYNC property of the XML document object to false before you try and load any XML data and then check the error.0 -
Now it works, The code provided by ta5 was correct, I simply forgot a CREATE statement. The hint with the Async Flag is very interesting. I'll check this too.
Thanks to everyone for the help.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