9.2.4.2 XML Parsing Rules
Independent of the style of XML, the parsing process needs to determine:
-
Transaction boundaries
-
Operation entries and metadata including:
-
Column entries and metadata including:
-
Either the column name or index; if both are specified the system will check to see if the column with the specified data has the specified name.
-
Column before or after values, sometimes both.
-
This is done through a set of interrelated rules. For each type of XML message that is to be processed you name a rule that will be used to obtain the required data. For each of these named rules you add properties to:
-
Specify the rule as a transaction, operation, or column rule type. Rules of any type are required to have a specified name and type.
-
Specify the XPath expression to match to see if the rule is active for the document being processed. This is optional; if not defined the parser will match the node of the parent rule or the whole document if this is the first rule.
-
List detailed rules (
subrules
) that are to be processed in the order listed. Whichsubrules
are valid is determined by the rule type.Subrules
are optional.
In the following example the top-level rule is defined as genericrule
. It is a transaction
type rule. Its subrules
are defined in oprule
and they are of the type operation
.
xmlparser.rules=genericrule xmlparser.rules.genericrule.type=tx xmlparser.rules.genericrule.subrules=oprule xmlparser.rules.oprule.type=op
Parent topic: XML Parsing