Patent ID: 7398265

Claim:
A method for handling path-based queries, the method comprising: receiving a path-based query that specifies a path associated with data in an XML document; generating, based on the path, an index-enabled query that accesses an XML index that indexes a plurality of XML documents, including said XML document; and executing the index-enabled query to use said XML index to retrieve said data required by the path-based query; wherein generating the index-enabled query includes: identifying a template, of a plurality of available templates, that corresponds to a format of a portion of the path-based query without regard to names of elements in the portion of the path-based query; and generating at least a portion of the index-enabled query based on a rule associated with the template that corresponds to the format of the portion of the path-based query; wherein each template, within the plurality of templates, corresponds to a different format of path expression; wherein the rule associated with each template indicates how to translate path expressions that have the format, that corresponds to said each template, to expressions to be used in the index-enabled query.