Patent ID: 8275774

Claim:
A streaming query method for extensible markup language, comprising: receiving and analyzing a user-input XPath (Extensible Markup Language Path Language) document; receiving a result obtained by analyzing the XPath document, and building an abstract syntax tree accordingly, wherein the building of the abstract syntax tree comprises the steps of: establishing a single tree structure according to the result obtained by analyzing the XPath document; and dividing the single tree structure into independent and undividable tree-structure components; receiving an Extensible Markup Language (XML) document, and parsing nodes of the XML document; generating an index of the XML document according to the result obtained by analyzing the XML document; and receiving the abstract syntax tree and the index, performing a format computation and obtaining a query result accordingly; wherein the establishing the single tree structure comprises the steps of: when receiving a query string input by a user, loading one line of the query string at a time; extracting an axis of the loaded query string; generating an operator; performing a node test; retrieving an operand, and assigning an unspecified variable to the operand; establishing a tree structure according to the operator and the operand; and determining whether a backward axis exists in the operand, and if the backward axis exists in the operand, reversing the tree structure, otherwise maintaining the original tree structure.