Home | Download | Purchase | Contact | News | Support | FAQ | Links | Site map | |
Innovative XML solutions since 2003
ExamXML
MDCXML
JExamXML
xml2csv
csv2xml
|
CompareXML
MDCXML provides API for using XML comparison functionality within user's application
written on C, C++, C# .NET. Delivery package includes DLL mdcxml.dll and header file
XMLComparator.h than should be included in source code. To use mdcxml.dll it
should be included to PATH environment variable.
int CompareXML(
LPCTSTR firstXmlFile,
LPCTSTR secondXmlFile,
LPCTSTR outputXmlFile,
UINT outputFileMode,
LPCTSTR optionsFile
);
firstXmlFile
secondXmlFile
outputXmlFile
outputFileMode
optionsFile
Return Value Remarks MDCXML prints errors and result of comparison to console screen (default) and/or to Message Box. There are two options in the option file that set printing device PrintResultToScreen MDCXML prints errors and result to Console Screen (useful for console application) PrintResultToWindow MDCXML prints errors and result to Message Box (useful for Window's application) To switch off any messages and turn MDCXML in silent mode set both options to 0. Header : Declared in XMLComparator.h
#include <Windows.h> #include <tchar.h> #include "XMLComparator.h" int _tmain(int argc, _TCHAR* argv[]) { int retval = -1; HINSTANCE hinstLib = LoadLibrary(MDCXML_LIB); if (hinstLib) { COMPAREXMLPROC proc = (COMPAREXMLPROC) GetProcAddress(hinstLib, MDCXML_PROC); if (proc) { retval = (proc)(_T("test1.xml"), _T("test2.xml"), _T("out.xml"), ID_SAVE_DIFF, _T("options")); } FreeLibrary(hinstLib); } return retval; } C#: using System; using System.Runtime.InteropServices; class Examxml { [DllImport("mdcxml.dll", CharSet=CharSet.Unicode)] static extern long CompareXMLW(String xmlfile1, String xmlfile2, String outfile, uint mode, String optionsfile); public static void Main() { Examxml.CompareXMLW("first.xml", "second.xml", "diff.xml", 980, ""); } } Python: from ctypes import * windll.mdcxml.CompareXMLW(u'first.xml',u'second.xml',u'diff.xml',980,u'options') windll.mdcxml.CompareXMLA('first.xml','second.xml','diff.xml',980,'options') VB.NET: Public Declare Function CompareXMLA Lib "mdcxml.dll" (ByVal xmlfile1 As String, ByVal xmlfile2 As String, ByVal outfile As String, ByVal mode As Long, ByVal optionfile As String) As Long Public Sub Main() CompareXMLA("struts.xml","struts2.xml","d32.xml",980,"") End Sub VB: <DllImport("mdcxml.dll")> _ Private Shared Sub CompareXMLA(ByVal xmlfile1 As String, _ ByVal xmlfile2 As String, _ ByVal outfile As String, _ ByVal mode As Long, _ ByVal optionfile As String) As Integer End Sub |
Copyright © 2003-2024 A7Soft. |