XML for RPG and Procedural Languages Documentation

Readme
Installation
API Docs
Samples
Programming
License

Building the COBOL samples

    Before you can create the modules you must include the library that has the header files in the user library list.
    addlible XML4PR400

    Whenever you see <progname> replace it with the name of a program from the list below.

    For DOMCount and DOMPrint
    1. Create the modules:
      crtcblmod module(<yourlibrary>/<progname>) srcfile(xml4pr400/qcbllesrc)
    2. Create the program by binding the module to the XML4PR400 service program:
      crtpgm pgm(<yourlibrary>/<progname>) module(*pgm) bndsrvpgm(xml4pr400/xml4pr400) actgrp(*new)


    For SAXCount and SAXPrint

    Because of the callback mechanism the SAX based parsers in COBOL must build two programs. More information on how the callbacks are set up can be found in the COBOL samples explanation.

    The following example shows how to build SAXCount. To build SAXPrint replace all occurrences of "SAXCount" and "SAXCounter" with "SAXPrint" and "SAXPrinter" respectively.

    1. Create the modules:
      crtcblmod module(<yourlibrary>/SAXCount) srcfile(xml4pr400/qcbllesrc)
      crtcblmod module(<yourlibrary>/SAXCounter) srcfile(xml4pr400/qcbllesrc)
    2. Create the program by binding the module to the XML4PR400 service program:
      crtpgm pgm(<yourlibrary>/SAXCount) module(*pgm) bndsrvpgm(xml4pr400/xml4pr400)
      crtpgm pgm(<yourlibrary>/SAXCounter) module(*pgm) bndsrvpgm(xml4pr400/xml4pr400) actgrp(*caller)
    3. Add yourlibrary to the library list (the SAXCounter program must be in a library that is on the library list for the SAXCount function to locate it):
      addlible <yourlibrary>

    Here is a listing of the COBOL sample programs provided:

      DOMPrint - Uses the DOM parser to print the supplied XML document with the XMLFormatter.
      DOMCount - Uses the DOM parser to count the number of elements in an XML file.
      SAXCount - Uses the SAX parser to count the number of elements in an XML file.
      SAXPrint - Uses the SAX parser to print the supplied XML document with the XMLFormatter.
      SAX2Count - Uses the SAX2 parser APIs to count the number of elements in an XML file.
      SAX2Print - Uses the SAX2 parser APIs and the XMLFormatter to print the contents of an XML file.


XML4PR - XML4C Interface Wrapper for RPG, C and COBOL
Copyright 2000,2001,2002 International Business Machines. All Rights Reserved.