InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Method and System for Handing Error Correctly in XML Path Language (XPath) Evaluation

IP.com Disclosure Number: IPCOM000243599D
Publication Date: 2015-Oct-05
Document File: 5 page(s) / 224K

Publishing Venue

The IP.com Prior Art Database


A method and system for handing error correctly in XML Path Language (XPath) evaluation is disclosed.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 38% of the total text.

Page 01 of 5

Method and System for Handing Error Correctly in XML Path Language (XPath) Evaluation

XML Path Language (XPath) is an expression language that was designed by a World Wide Web Consortium (W3C) to allow processing of Extensible Markup Language (XML) data that conforms to XQuery 1.0 and XPath 2.0 data models. DB2* XPath supports a subset of language which is constructed in a W3C recommendation and includes abbreviated syntax of location path expressions and functions of a core library.

As the XPath data model is a hierarchy (tree) of nodes representing an input XML document, the XPath basically involves three parts. First part matches data nodes against a skeleton of location path (axis and node test), which can be efficiently

performed in a streaming manner to generate an initial node-set for each location step. The streaming manner includes pre-order traversal of a document tree. Second part evaluates predicates in square brackets which are expected to return Boolean values used for filtering a candidate node-set. This is generally done in a bottom-up fashion level by level, for nodes that satisfy associated predicates to be uploaded to an upper level. Third part evaluates any function calls as required. In most cases, operands of various expressions, operators, and functions need to conform to expected types. DB2* ignores type errors in certain situations, such as when error occurs in internal casting inside of a predicate. However, in other cases such as when explicit casting functions are evaluated, regardless of inside or outside of predicates, errors need be raised, if any. However, an error can be encountered at a deeper level of a data tree before the upper-level predicates along the path to a root have been confirmed to be true. Logically, if any of the predicates were to be evaluated as "False", the error should not be raised.

Disclosed is a method and system for handing error correctly in XML Path Language (XPath) evaluation. The method and system seamlessly integrates a mechanism for correct error handling into an infrastructure of XPath evaluation. In other words, error encountered during the XPath evaluation is buffered in Structured Query Language Communication Area (SQLCA) and reporting is deferred until all predicates along a path to a root are confirmed to be true.

Two new variables for book-logging an encountered error are introduced, which are as


xQNhasDeferER PTR(64), ! Qnode that corresponds to either the error data origin or where the error is uploaded to

xHasDeferredER BIT(1), ! YES if an error is encountered

Both variables are initiated to 0.

The correct error handling mechanism in XPath evaluation tries as much as possible to not change a current code so as to minimize the impact and the data is still streaming in. When the data are being matched top-down, the error is captured in SQLCA, if the error is encountered. However, when summarizing up predicate evaluation bottom-up, the error can be era...