 |
LMX™
W3C XML Schema to C++ Data Binding
XSD C++ XML data binding; Fast development; Easy to learn.
|

Have a question? E-mail
|
|
[Print]
Suggested LMX Evaluation Steps (Windows)
Below are some suggested steps for evaluating LMX under Windows.
We also have
suggested steps for evaluating LMX under Linux.
- Download and install the LMX evaluation.
- Create a new directory in which you can start the evaluation.
- Copy a simple
XML schema file
(or alternatively, an example of the XML you want to read
or an Annotated XML Example),
and a file containing an XML instance of the schema to the directory.
These files will be referred to as myschema.xsd and
myschema.xml below, but you can call them what you like. (We suggest using
a simple, single-file schema to start with so that you can focus on the LMX
aspects rather than the details of the schema. If you wish, you can use
user-preferences.xsd schema and user-preferences.xml instance which are provided
as part of the installation. They are typically installed in the
C:\Program Files\LMX\examples directory.)
- Start running WinLMX.
- Drag the myschema.xsd file (using Windows Explorer) over the WinLMX
application.
- Select the 'Basic Options' tab in WinLMX.
- Make sure the 'Generate Test Framework File (-tframework)' checkbox is checked
(it is towards the top-right of the options). (This causes myschema-main.cpp
to be generated - see below.)
- Press the 'Compile...' button in WinLMX.
- Assuming your schema has compiled correctly, this should have generated the
following files: myschema.h, myschema.cpp, myschema-main.cpp and myschema.html.
The main marshalling and unmarshalling code is contained in the myschema.h and
myschema.cpp files. myschema-main.cpp includes a main() function and code to
unmarshal an XML instance from a file into objects and then marshal the objects
back into another file.
- Run-up your development environment and create a new Win32 Console project for
the evaluation.
- Move the files myschema.h, myschema.cpp, myschema-main.cpp into the project.
- Make sure the development environment is able to access the LMX files called
lmxuser.h, lmxinternals.h, lmxparse.h, and lmxtypes.h (typically these can be
found in the directory C:\Program Files\LMX\supporting-software\include).
The simplest way to do this may be to copy these files to the evaluation
directory.
- Copy one of lmx-MLd-vc6.lib (for VC6), lmx-MLd-vc71.lib (for VS 2003),
lmx-MTd-vc8.lib (for VS 2005), lmx-MTd-vc9.lib (for VS 2008) or
lmx-MTd-vc10.lib (for VS 2010) to the evaluation directory. (Typically these
can be found in the directory C:\Program Files\LMX\supporting-software\win32.)
(If you want to use a DLL version of the LMX libraries, make sure you arrange
for the #define LMX_WANT_DLL to be set to 1, either by modifying the code in
lmxuser.h, including the statement #define LMX_WANT_DLL 1 in your code prior
to including lmxparse.h, or by modifying the project's properties.)
- Add the selected library to the project in the development environment.
- Make sure the project will link to the correct version of the C runtime (e.g.
make sure "Project"->"Properties"->"Configuration Properties"->"C/C++"->"Code Generation"->"Runtime Library"
is set to MLd or MTd if you are using the non-DLL LMX libraries mentioned above).
- Compile the project using the development environment.
- This should create an executable called myschema.exe.
- Modify the development environments settings so that when the program is run it
is given the following arguments: myschema.xml myschema-out.xml
(using "Project"->"Properties"->"Configuration Properties"->"Debugging"->"Command Arguments")
- Run the program in the IDE.
- You should see that myschema-out.xml contains an XML instance similar to
myschema.xml.
- You have now completed your first use of LMX. To evaluate further, modify the
the code in myschema-main.cpp to interact with the generated classes, for
example printing out specific values to the screen, or setting certain values
before the data is marshalled to the myschema-out.xml file. Looking at
myschema.html should help with this, as should looking at the example at
http://www.codalogic.com/lmx/lmx-example.zip.
You can also add more to the schema file, or try more complex schemas.
- If you have questions,
.
Thank you for evaluating LMX.
[Print]
|