Document Class Reference

The Document class is a specialized XML DOM for XDDL documents.

Typically, users will create a Document from an XDDL file, and reference to this document is then used to create a Message. These are usually the only methods invoked.

Any parse errors in the document will result in an exception derived from std::exception.

Constructors
Document()Create an empty document.
Document(const char * filename)Create a document from an XDDL file. This constructor is equivalent to calling the empty constructure and then the open() method.
Methods
void open(const char * filename) Open an XDDL file. This method will load a file into an existing document, replacing the previous document.
void clear()Clear the Document, making it empty.
bool empty() constReturn true of the document is empty.

Detail

The example below shows a complete program that loads and XDDL document, creates a message, and then displays the decode in XML.

#include <IT/Xenon.h>

using namespace std;
using namespace IT;

int main(int argc, char* argv[])
{
    try {
        Document doc("C:\\Program Files\\Intrig Data Monitor\\xddl\\icd.xddl");
        Message msg(doc);
        msg = BitString("030001547B0DA16006");

        cout << msg.xml();

    } catch (exception & e)
    {
        cout << e.what();
    }

    return 0;
}