XML for RPG and Procedural Languages Documentation

Readme
Installation
API Docs
Samples
Programming
License

XML4PR Samples

Building the Samples

    XML4PR samples demonstrate salient features of the parser using simple applications written on top of SAX and DOM APIs provided by the parsers.

    Many of the same samples are provided in each of the supported languages. Instructions for building the samples are broken down by language. To see specific instructions for a language, select from the list below:

    To assist in creating the samples, CL program source has been provided in source file QCLSRC in library XML4PR400. By creating the appropriate CL program and calling it with a target library, the samples will be created for you.
    • CRTXMLC - Creates XML C sample programs in target library
    • CRTXMLCBL - Creates XML Cobol sample programs in target library
    • CRTXMLRPG - Creates XML RPG sample programs in target library


    Note when calling the COBOL SAX/SAX2 samples provided, the event handler programs (ex. SAXCOUNTER) are not library qualified in the source code, so you will need to make sure that the program's library is on the library list.

Running the Samples

    Once the samples have been built, the following command can be used to execute the samples:
      call <yourlibrary>/<samplepgm> [options] <XML file>

    <yourlibrary> is the library that the programs were created in and <samplepgm> is the name of the sample you want to run (note that not all samples are available in all of the supported languages).
    Command Line Options - Some of the samples require specific command line input parameters. Run the program without any parameters to get usage information for each sample. The command line parameters are specific to the sample and the programming language it was implemented in. For the most part, optional parameters precede and required parameter, which is frequently the XML File name.
    XML File - Some of the samples require as input an XML file. This must be either a fully qualified IFS path name or the parser will look for the XML file in the current working directory.

In-Depth Explanation of API Calls

    Choose a sample from the list below to view an annotated source listing that explains how the API is used.
  • DOMCount: RPG C COBOL
  • SAXCount: RPG C COBOL

Disclaimer:
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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