Build Parsing Subprocedure (BLDPRS)
The BLDPRS command is used to aid in writing RPG-XML Suite XML or JSON parsing code to be used with the RXS_Parse() and RXS_ParseJson() subprocedures. These APIs rely on a “handler” subprocedure which captures various XML or JSON parsing events, and gives you access to the data in the document being parsed.
When provided with a sample XML or JSON file in the IFS, BLDPRS can generate a handler subprocedure for that document. It can generate in either mixed-format (fixed D-specs) or free-format (column limited) RPG. Once generated, this parsing handler can be copied into your program code.
Note: You will need to make manual modifications to the generated parsing handler in addition to importing it into your program. The generated code does not include any data handling logic.
Parameters
XML or JSON Stream File (SRCSTMF)
This is a required parameter.
Provide the fully-qualified file path to your sample XML or JSON document in the IFS.
Possible Values:
- character-value
- IFS path to XML or JSON file that will be read to generate the parsing handler subprocedure.
Output Source File (OUTFILE)
This is a required parameter when the generated code is to be written to a source member.
Specify the source physical file (and optionally the library) for the output source member.
Possible Values:
- character-value
- Physical file name in which the source member exists, or will be created.
Output Member Name (OUTMBR)
This is a required parameter when the generated code is to be written to a source member.
Specify the name of the source member to which the generated code will be written. This source member will be created if it does not already exist.
Possible Values:
- character-value
- Source member that either exists or will be created.
Output Stream File (OUTSTMF)
This is a required parameter when the generated code is to be written to a stream file in the IFS.
Specify the fully-qualified file path to the output stream file in the IFS.
Possible Values:
- character-value
- IFS path to the file where the parsing handler code will be written.
Code Format (CODEFORMAT)
This is a required parameter.
Specify whether the generated code should be mixed- or free-format RPG.
Possible Values:
- *FREE
- Generate free-format code. This is the default value.
- *MIXED
- Generate mixed-format code.
Parser Type (PARSETYPE)
This is a required parameter.
Specify which type of parsing handler is to be generated.
Possible Values:
- *RXS2XML
- Generate an XML parsing handler that is compatible with programs using the RXS 2 parsing API.
- *RXS3XML
- Generate an XML parsing handler that is compatible with programs using the RXS 3 parsing API.
- *JSON
- Generate a JSON parsing handler.
Generate Content Parsing (XMLCONTENT)
This parameter is only used when generating an XML parsing handler.
Specify if XML “content” events should be captured in the generated parsing handler subprocedure.
Possible Values:
- *YES
- Generate XML "content" events. This is the default value.
- *NO
- Do not generate XML "content" events.
Generate Begin Element Parsing (XMLBEGIN)
This parameter is only used when generating an XML parsing handler.
Specify if XML “begin element” events should be captured in the generated parsing handler subprocedure.
Possible Values:
- *YES
- Generate XML "begin element" events. This is the default value.
- *NO
- Do not generate XML "begin element" events.
Generate End Element Parsing (XMLEND)
This parameter is only used when generating an XML parsing handler.
Specify if XML “end element” events should be captured in the generated parsing handler subprocedure.
Possible Values:
- *YES
- Generate XML "end element" events. This is the default value.
- *NO
- Do not generate XML "end element" events.
Generate Attribute Parsing (XMLATTR)
This parameter is only used when generating an XML parsing handler.
Specify if XML “attribute” events should be captured in the generated parsing handler subprocedure.
Possible Values:
- *YES
- Generate XML "attribute" events. This is the default value.
- *NO
- Do not generate XML "attribute" events.