Hi,
Using the 'XML Import Sample v1.0i' as is from the Download section, I have no problems. I would like the sample to import multiple xml-files simultaneously though, but faced with the error message (attached image), I'm stuck.
Now, as mentioned, the sample are working just fine as is with minor adjustments to accommodate the file structure.
If the existing code on the OnRun trigger is inactivated and/or replaced with:
XMLFile.INIT;
XMLFile.RESET;
XMLFile.SETRANGE(Path, 'C:\TEMP\TEST\ARCHIVE\');
XMLFile.SETRANGE("Is a file", TRUE);
IF XMLFile.FINDFIRST THEN BEGIN
REPEAT
FileName := XMLFile.Name;
OpenXMLDocument(FileName,XMLDocument);
ImportXMLFile(FileName);
UNTIL XMLFile.NEXT = 0;
END ELSE BEGIN
MESSAGE('No files to import');
END;
The errormessage is triggered.
These are the Locals on OnRun:
Name DataType Subtype
XMLDocument Automation 'Microsoft XML, version 2.0'.DOMDocument
XMLFile Record File
My xml-structure is as follows:
<ORDER>
<HEADING>
<DEPT>200</DEPT>
<NO>5000</NO>
</HEADING>
</ORDER>
If you have any suggestions, please don't hesitate
Answers
Have you created the XMLDOM like
CREATE(XmlDoc);
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Use the create statement to initialize the automation variable xmlDocument.
Hope this helps
Thomas
This is the code (Emiel Romein) http://www.mibuso.com/dlinfo.asp?FileID=329
Christian
Christian