Patent ID: 8583623

Claim:
A method of pre-processing an XQuery on an XML data base, the method comprising: using a computer to perform: receiving the XQuery; parsing the XQuery to obtain an abstract syntax tree; typing the abstract syntax tree to provide at least one pointer into a schema for XML documents of the XML data base, wherein said typing involves the use of schema data and a list of paths defining structural information of locations of elements or attributes occurring in XML documents of the XML data base, and wherein said typing comprises: inspecting an XPath expression of the XQuery in a stepwise manner, and for each location step along an axis in the path expression corresponding to a node in the abstract syntax tree: determining type information for the node from the schema data or the list of paths based on the axis of the location step or information regarding a previous location step; identifying a set of pointers onto the schema in accordance with the XPath expression of the XQuery based on the type information; and excluding pointers, which, according to the list of paths, do not occur in the XML data base; wherein after said parsing and said typing the XQuery is executable to be performed on the XML database.