Abstract:
Since XML documents have become a major data source to use for any purpose, XML queries, such as XPath, are a new required skill for developers. However, writing a meaningful XPath query is not simple. Many semantic errors are very hard to detect. In this project, we provide an XPath semantic checking tool which is a prototype to fulfil the fundamental requests from semantic checking in XPath queries. The tool detects semantic errors in objects, relationships and attributes of ORA-SS and classifies the errors into different categories. The DTD is used to store the semantic information in the XML documents. However the normal DTD cannot fully support the tool. Thus an extension of the DTD is generated. The other significant part of the tool is the parser. The parser does not operator like a typical parser. It separates the XPath expression into 4 parts: family code, collection code, child condition groups and simple condition groups. These 4 are used by semantic checking module to do the final checking. The final the semantic checking is done by the semantic checking module. It uses all the information from the DTD and the parser to check semantic errors. Any error found will be reported to the user. A case study is provided to evaluate the functions in the XPath semantic checking tool. Through a number of XPath test cases, various types of errors will be detected by the tool. From the result, it is shown that the tool achieves the requirements.