Patent ID: 8615526
Filing Date: 2013-12-24
Classification: G06F

Abstract:
1. A computerized method in an eXtensible Markup Language (XML) generation system, for generating a Structured Query Language (SQL)-XML query, the computerized method comprising: receiving, by a query generation module, an XML template from an end user, wherein the XML template is an XML schema definition (XSD) indicating an outline structure of a target SQL XML document to be generated and wherein the XML template includes one or more nodes related based on attributes associated with data elements stored in an external database; receiving, by the query generation module, mapping information from the end user, wherein the mapping information is provided in the form of one or more XML mapping tables, table columns of which indicates a relationship between the one or more nodes of the XML template and the data elements stored in the external database; mapping, by the query generation module, based on the mapping information, the one or more nodes of the XML template with the table columns that are required at the one or more nodes; structuring and tagging, by a parsing module, the data elements from the one or more XML mapping tables as the one or more nodes of the XML template; parsing, by the parsing module, through the one or more nodes of the XML template to determine information indicating a structure of the XML template, wherein the structure of the XML template indicates a level of hierarchy and relationship between the one or mode nodes present in the XML template; creating, by the query generation module, a sub-query variable while parsing through the one or more nodes of the structure of the XML template, wherein the sub-query variable is a variable indicating queries generated at each hierarchy level of the XML template while parsing through the one or more nodes of the structure of the XML template; identifying, by the parsing module, whether at least one of the one or more nodes in the XML template is one of a root node, a single element, and a node at a next hierarchical level of the structure of the XML template; aggregating, by the query generation module, nodes present at a current hierarchy level and corresponding child nodes inside the current hierarchy level to the sub-query variable, based on the identification of the at least one of the one or more nodes; determining, by the query generation module, whether the at least one node is one of a unique identifier and a single element, the unique identifier uniquely identifies a specific row in the external database; generating, by the query generation module, at least one of an XML attribute when the at least one node is the unique identifier and an XML element when the at least one of the one or more nodes is a single element; aggregating, by the query generation module, at least one of the XML attribute and the XML element to the sub-query variable, based one the determination of the at least one of the one or more nodes; creating, by the query generation module, an inline view at each level of the structure of the XML template, wherein the inline view has visibility at each sub level based on hierarchy; creating, by the query generation module, a plurality of sub-query variables for each level of hierarchy; and generating, by the query generation module, the SQL-XML query by aggregating the plurality of sub-query variables.