RXS_XPath()

This subprocedure assists with building an XPath string. This is recommended over simply manually building an XPath string.

In addition to providing an easy way to include numeric replacement values, it also allows for including a wildcard namespace. The wildcard namespace syntax is translated to its’ XPath 1.0 equivalent and returned along with any replacements that were passed.

Subprocedure Prototype

D RXS_XPath...
D                 PR                  Extproc('RXS_XPath') Opdesc
D                                     Like(RXS_Var8Kv_t)

Returns the constructed XPath string.

D  pXPath                             Like(RXS_Var8Kv_t) Const
D                                     Options(*Varsize)

Holds the initial XPath string template

D  pReplacement1                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement2                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement3                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement4                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement5                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement6                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement7                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement8                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement9                10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

D  pReplacement10...
D                               10U 0 Value Options(*Nopass)

Holds a numeric replacement value. Replaces the first unreplaced %u found in the XPath string template.

Example Code

*--------------------------------------------------------------
* This example code demonstrates creating an XPath that can be used for
*  further processing.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB

D gXPath          S                   Like(RXS_Var1Kv_t)
 /free
  gXPath = RXS_XPath( '/*:bookstore/*:book' );

  *INLR = *ON;
 /end-free