Automated XPath Expression Generation via Schema Traversal
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Productivity
If automated XPath expression generation is implemented, then test case development time is reduced, but ensuring semantic validity becomes more complex
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.
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.
3Reliability
If comprehensive test coverage is achieved through numerous test cases, then functionality verification improves, but development resources are consumed
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.
Data Source
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.


