XPath Usage

Oracle BI Publisher uses XPath to access data elements. The following example shows a typical hierarchy tree of data elements:

This image is described in the surrounding text.

The XPath search procedure for DEPARTMENT_NAME in the example above is as follows:

  1. DEPARTMENT_NAME is inserted as <?DEPARTMENT_NAME?>

  2. <?DEPARTMENT_NAME?> is translated to the XPath .//DEPARTMENT_NAME

  3. .//DEPARTMENT_NAME searches for DEPARTMENT_NAME in the complete sub-tree, starting from the current context. That is, it searches for any element with the name field in the correct context. With large data sets, this search procedure can affect system performance.

For small documents, search time is negligible, but with large data sets use the full relative path to improve performance. For example, in the hierarchy tree above:

  • Instead of <?for-each:DEPT?> use <?for-each:/DEPT_SALS/DEPT?>

  • Instead of <?DEPARTMENT_NAME?> use <?./DEPARTMENT_NAME?>

Additionally, large documents might not fit into memory, thereby requiring disk access for searches. By using the full relative path, full tree searches are avoided, resulting in large performance improvements.