www.krengeltech.com

RXS_allAttrHandler

From Wiki

User Guide

Contents

Description

Call this subprocedure before RXS_parse to tell the parser to notify a specific subprocedure of your program every time it encounters an attribute within an element (e.g. <element myAttr="Attr content">I am the content</element>.) When the parser encounters the attribute, the specified handler will receive the value of the attribute (in this case “Attr content”).

Prototype

     D RXS_allAttrHandler...
     D                 pr
     D  pHandler                       *   value procptr

Parameters

pHandler
The address of the local subprocedure in your program for the parser to call when it encounters any attribute of any element. Use the %PADDR (Get Procedure Address) RPG BIF to obtain the address of the local subprocedure (e.g. %PADDR(myHandler)).

Return value

None.

Notes / Examples

Using this approach saves coding time when a program will retrieve a majority of the attributes values in a document. Also, the parser provides the data value of an attribute (i.e. attrname=”I am attr data value”) in the pData parameter of the handler when the attribute event takes place. This is different from the way the parser handles elements. Elements have separate events for their content (i.e. <element>element content</element> will generate three events – one for the beginning of the element, one for the element content, and one for the end of the element).