| 20080243904 | Methods and apparatus for storing XML data in relations - A method and data-processing apparatus for storing data from an XML document in a relational database, wherein the XML document conforms to an XML schema which specifies the types of elements which may be included in the XML document and child element types of the said element types, and wherein the relational database conforms to a relational schema, the method comprising the steps of, in respect of element types in the XML schema which have child element types, determining at least one rule in relation to the said element types, wherein the at least one rule specifies how to compute the value of attributes associated with child elements of an instance of an element of that type, taking into account at least the value of either or both an attribute associated with an instance of an element of that type and PCDATA of text children of an instance of an element of that type, wherein at least some of the said rules in relation to at least some of the said element types in the XML schema specify how to calculate tuples to be inserted into the relational database taking into account the value of either or both an attribute associated with an instance of an element of that type and PCDATA of text children of an instance of an element of that type; and traversing at least a required portion of the XML tree represented by the XML document, from the top down, and, for each node in the said portion of the XML tree which has child elements in the XML tree, executing the said at least one rule in relation to the element type of the node of the XML tree and, where specified by the said at least one rule, storing the computed value of the attributes of the child elements and, where it is specified by the said at least one rule, generating a tuple to be inserted into the relational database. The method enables selected data from an XML document to be stored in a pre-existing relational database and can handle XML documents which conform to a recursive XML schema. | 10-02-2008 |