Automated XPath Expression Generation via Schema Traversal

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The development of semantically valid XPath expressions for testing XPath processing engines is time-consuming and costly, as it requires manual creation of numerous test cases to ensure robust coverage of XPath expressions.

Innovation Solution

A method is introduced to automatically generate semantically valid XPath expressions by populating a sequence-type model, priming it to remove ambiguities, and scanning it to identify location paths that match a search pattern, using the XPath axes to form valid expressions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual test case development is used, then test case quality and semantic validity can be ensured, but development time and cost increase significantly

Engineering Contradiction:
Improvetest case semantic validityVSAvoidtest case development time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent uses XML schema documents as templates or copies that define the hierarchical structure and semantics of XPath expressions. By instantiating these schema documents, the system automatically generates semantically valid XPath expressions without manual creation, thus ensuring reliability while reducing time consumption.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent replaces the manual mechanical process of creating XPath test cases with an automated computational system. The system uses algorithms to traverse XML schema documents, generate XPath expressions, and validate them automatically, eliminating the need for manual test case development while maintaining semantic validity.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If automated XPath expression generation is implemented, then test case development time is reduced, but ensuring semantic validity becomes more complex

Engineering Contradiction:
Improvetest case generation speedVSAvoidsemantic validation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces XML schema documents as intermediary structures that bridge the gap between automated generation and semantic validity. These schema documents serve as a mediator that encodes the semantic rules and hierarchical relationships, allowing the system to automatically generate valid XPath expressions by traversing the schema rather than implementing complex validation logic.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent changes the approach from generating XPath expressions and then validating them to traversing pre-validated XML schema documents to directly generate valid expressions. By changing the parameter of generation source from raw data to structured schema, the system achieves both high productivity and semantic validity without complex validation mechanisms.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If comprehensive test coverage is achieved through numerous test cases, then functionality verification improves, but development resources are consumed

Engineering Contradiction:
Improvefunctionality verificationVSAvoidnumber of test cases
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent makes the XML schema document universal by using it to generate multiple XPath expressions that cover different functionality. A single schema document can produce numerous valid XPath expressions by traversing its hierarchical structure, allowing one source to serve multiple testing purposes and reducing the total number of test cases needed while maintaining comprehensive coverage.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS7467157B1Generation of semantically valid xpath expressions
Publication Date: 2008.12.16 SAP SE
  • US7467157B1 patent drawing
  • US7467157B1 patent drawing
  • US7467157B1 patent drawing

AI summary

A method for automatically generating semantically valid XPath expressions in a computer system is provided. The method includes populating an instance of a sequence-type model by organizing XML data into a hierarchical structure consistent with the sequence-type model. The method also includes priming the instance of the sequence-type model to remove ambiguities and redundancies, while retaining semantic validity of the instance of the sequence-type model. The method further includes scanning the instance of the sequence-type model to identify one or more location paths that match a search pattern, where an initial scan originates at a root of the hierarchical structure and subsequent scans originate from a termination point of a prior scan to incrementally search for location steps by searching along XPath axes. The method additionally includes determining whether a sequence type at each location step matches the search pattern and outputting a result as semantically valid XPath expression output.