[Print] [Close]
Suggested LMX Evaluation Steps (Linux)
Below are some suggested steps for evaluating LMX under Linux.
We also have
suggested steps for evaluating LMX under Windows.
- If you haven't already, download and install LMX from https://codalogic.com/lmx/download.php.
- Create a new directory in which you can start the evaluation.
- Copy a simple XML schema file, 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 "examples" sub-directory of the installation.)
- Start Glinmx.
- Press the "Browse" button next to the "Base Schema File" edit box and select
the schema.
- Copy the schema name from the "Base Schema File" edit box into the edit box
next to "Output File Base Name".
- Remove the ".xsd" extension from the name in the "Output File Base Name" edit
box.
- Select the "Basic Options" tab.
- Make sure the "Generate Test Framework .cpp File" box is checked (about half
way down on the right-hand side).
- Press the "Compile..." button at the bottom of Glinmx.
- 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.
- An LMX project needs access to some additional Runtime Supporting Software that
includes the low-level XML parser and type classes. The .h header files for this code
are contained in the supporting-software/include sub-directory of the installation.
The simplest way to do this for evaluation purposes is to copy the files lmxuser.h,
lmxinternals.h, lmxparse.h, lmxtypes.h, lmxregex.h and lumxunicode.h into the
directory containing your generated code.
- The .cpp files for the Runtime Supporting Software are contained in the
supporting-software/src sub-directory of the installation. You can build these into
various forms of library, but for evaluation purposes the easiest thing to do is
copy the files lmxparse.cpp, lmxtypes.cpp, lmxregex.cpp and lmxunicode.cpp
into the directory containing your generated code.
- Run a C++ compiler command similar to:
g++ -o myschema myschema-main.cpp myschema.cpp lmx*.cpp
- This should create an executable called myschema.
- Run the program using the following command-line:
myschema myschema.xml myschema-out.xml
- 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 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
https://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, please just ask - evalsupport@codalogic.com.
Thank you for evaluating LMX.
[Print] [Close]