ZeusBase-Library

3.2 XML_Service

The XML-Service module is an adapter between an XML API and the Zeus-Framework. Mainly the DOM Structure and the XSLT Processing is supported so far. The XML API is wrapped in Zeus-Interfaces. This allows to use XML across the heterogenous module architecture. Following API's are supported:

  • MSXML: available for Windows Platforms only
  • Xerces from Apache: available for Linux and optionally also for Windows. For XSLT the Xalan implementation is used.

The XML_Service provides following interfaces:

  • IXMLParser: defines the parser interface to build a DOM tree
  • IXMLErrorReporter: handler to receive errors while parsing an XML document
  • IXMLDocument: defines the document interface (root)
  • IXMLNode: Interface defines the access to a simple DOM node
  • IXMLNodeList: Interface defines the access to the child node list of a DOM node
  • IXSLProcessor: Defines the processor of the style sheet transformator.

The interfaces are located in zeusbase/System/Interfaces.

Two objects are exported, the IXMLParser and IXSLProcessor. These objects can be created using the LibraryManager:

#include <zeusbase/System/LibraryManager.h>
#include <zeusbase/System/Interfaces/IXMLParser.hpp>

...

  TAutoPtr<IXMLParser> ptrParser;
  if (LibraryManager.createObject(TString(L"XML_Service"), 
                                  TString(L"IXMLParser"), 
                                  ptrParser.getInterfaceReference()) == RET_NOERROR)
  {
    //Now the XML Parser can be used
    ...
  }

3.2.1 Extras

The Zeus-Framework is able to run without the XML_Service module, but all XML based classes like X-Objects, XML-File classes etc. won't work.

The Xerces and Xalan can be built manualy. Make sure you build the libraries as UNICODE. Zeus-Framework is based on UNICODE strings. For other API's implement the interfaces of the XML_Service and wrap the API objects.