Storing multipart XML documents

A method for storing an XML document, the method including decomposing the XML document into a hierarchy of nodes and creating an index of the nodes.

BACKGROUND

1. Technical Field

The present disclosure relates to XML documents and, more specifically, to storing multipart XML documents.

2. Description of the Related Art

Extensible Markup Language (XML) is a popular markup language capable of describing many different types of data, by which software applications can communicate with one another and with human users. XML is a human readable markup language. XML instructions can be read and understood by a human, in contrast to, for example, computer languages that store and send information as binary data.

Because XML is a human readable, platform independent standard, data formulated in XML may be read and interpreted by any computer utilizing any platform, and is easily manipulated and tested by software developers. The ease of use of XML across many different hardware and software environments makes it a popular choice for communication between modern computer software, especially web services based applications. The growing popularity of web services based applications and XML has created a growing demand for new and useful methods to make the programming of web based applications quicker, easier and more efficient. The Apache Cocoon Project (cocoon) is one example of such a system. Cocoon is a web development framework built around the concept of separation of concerns and component-based web development. Cocoon seeks to provide a framework by which a set of components may be programmed where each component provides an isolated function. These components may then be used as building blocks for the development of more complex components and/or complete web services based applications. Using the cocoon framework, users may be able to hook together a series of pre-developed components to form a web based application without needing to engage in the minute details of computer programming. Cocoon also allows users to extract added benefit from programmed components by reusing them in a wide range of web applications without reprogramming what has previously been programmed.

XML document tools have been developed for the storing and searching of data. For example, Lightweight Directory Access Protocol (LDAP) provides for the accessing of on-line directory services. As part of the cocoon framework, a method is provided for the storing and searching of XML document data. Cocoon provides for a database implementation that allows for the manual indexing of particular elements of an XML document, allowing for the XML document to be located during a search. However, cocoon's ability to search for particular subdocuments of an XML document is very limited.

Other methods for searching through XML documents exist. For example, XML documents may be searched through linearly, one after another. However, such a non-indexed search can take a long time, especially in light of the long length of XML documents attributable to their human readable nature.

SUMMARY

A method for storing an XML document, the method including decomposing the XML document into a hierarchy of nodes, and creating an index of the nodes.

A method for searching for an XML document, the method including searching for the XML document using an index that has been created by decomposing one or more XML documents into a hierarchy of nodes.

A system for storing an XML document, includes a decomposing unit for decomposing the XML document into a hierarchy of nodes, and a creating unit for creating an index of the nodes.

A system for searching an XML document, includes a searching unit for searching the XML document using an index that has been created by decomposing one or more XML documents into a hierarchy of nodes.

A computer system includes a processor and a computer recording medium including computer executable code executable by the processor for storing an XML document. The computer executable code includes code for decomposing the XML document into a hierarchy of nodes, and code for creating an index of the nodes.

A computer system includes a processor and a computer recording medium including computer executable code executable by the processor for searching an XML document. The computer executable code includes code for searching the XML document using an index that has been created by decomposing one or more XML documents into a hierarchy of nodes.

DETAILED DESCRIPTION

The present disclosure describes a system and method for indexing and searching through stored XML documents and XML sub documents. According to embodiments of the present disclosure, searching through stored XML documents and sub documents may be quick and may minimize processor overhead, for example, it may be computationally efficient. According to embodiments of the present disclosure, search results may be returned as the actual text of the XML document. This may offer advantages, for example, the retrieval of actual XML text may facilitate XML cryptography.

FIG. 5shows a flowchart illustrating an embodiment of the present disclosure. First, an XML document may be provided (Step S51).FIG. 1shows an example of an XML document11that may be provided to be stored and searched according to an embodiment of the present disclosure. The XML document11defines “presents” as including a dragon toy that has a green color and a fluffy type, a horse toy that has a green color and a hairy type, and chocolate food. Embodiments of the present disclosure will be described with respect to this example XML document. Of course, the same methods and systems may be applied, more generally, to any XML document or document.

FIG. 2shows a diagram of how the example XML document11to be stored and searched according to an embodiment of the present disclosure is organized. The complete XML document21defines presents. Within this document21, three sub documents22,23,24may be found. A sub document is a portion of a document that may be hierarchically below a document or sub document and/or may be capable of independent function. The first sub document22defines a dragon. The dragon sub document22is defined as a toy having a green color25and a fluffy type26. The green color22and fluffy type26are themselves sub documents that define individual characteristics. For example, the green color sub document25defines green as a color.

The second sub document23defines a horse. The horse sub document23is defined as a toy having a blue color27and a hairy type28. The blue color27and the hairy type28are themselves sub documents that define individual characteristics.

The third sub document24defines chocolate. The chocolate sub document24is defined as a food but has no sub documents defined within it.

After an XML document has been provided (Step S51), the provided XML document may be decomposed (Step S52). Decomposing an XML document may be the process of dividing the program into discrete units that can be searched.FIG. 3shows how the example XML document11may be decomposed according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, an XML document may be decomposed into one or more nodes.FIG. 4shows the text of the nodes that the example XML document may be decomposed into according to an embodiment of the present disclosure. These nodes may be hierarchical whereby a parent node may have one or more children nodes. The first node generally represents the entire XML document.

Along with the XML document or sub document text, each node may contain a unique directory identifier. The unique directory identifier may list a node number as well as node numbers for the parent of the node and all other ancestors, where they may exist. Each node may contain a node element name. The node element name may be, for example, a name for the node. This name, for example, may be used to identify the node in an index (directory) that may be created to facilitate searches. Each node may contain one or more node attributes. These attributes may be a list of any characteristics of the node that may facilitate searching for that particular document or sub document. The inclusion of node attributes is an optional feature of the present disclosure and other embodiments of the present disclosure do not use node attributes. Where desired, node attributes may be manually entered by a user or automatically generated by analyzing the text of the document or sub document. Additionally, other values may be stored as part of the node. For example, other values may be stored to facilitate searching.

The first node31, according to the example XML document11, represents the entire example XML document11. The hierarchical position of this node31is shown inFIG. 3. The full text41of the first node31is shown inFIG. 4. In addition to containing the full text of the XML document11, the first node31contains a node element name, here “Node1” and a unique directory identifier, here Element=1. Because only one element is listed as the unique directory identifier, it is clear that this node represents the top of the hierarchy, for example, the full XML document.

Complete XML documents, for example, nodes representing the top of the hierarchy, may list the full XML document as the program text as shown inFIGS. 3 and 4. XML sub documents, for example, nodes that may be in a position other than the top of the hierarchy, for example, children of the complete XML document or children of other sub documents, may list the XML document section that defines that sub document including all sub documents of that sub document, if any should exist, as well as all other sub documents that may be descendents of that sub document.

For example, the second node32represents a sub document of the example XML document11that defines the toy dragon. The text42of the second node32is shown inFIG. 4. In addition to including the XML text that defines the dragon as a toy, the text of the second node32includes the XML text that defines the color green, which is its self a node35and an XML sub document, and the XML text that defines the type fluffy, which is its self a node36and an XML sub document.

In addition to including the XML text of the toy dragon sub document, the text42of the second node32, contains a node element name, here “Node2” and a unique directory identifier, here Element=2, Element=1. Because two elements are listed as the unique directory identifier, it is clear that this node is the second node and is a child of the first node on the hierarchy.

Likewise the third node through the eighth node33-38all contain the definitions of their particular sub document along with all of the sub documents that may be their respective descendents. The text of these sub documents43-48respectively contains the XML text that defines their particular sub document along with all of the sub documents that may be their respective descendents along with their respective node element names and unique identifiers.

After an XML document has been decomposed into nodes representing the XML document and all sub documents as a hierarchy of nodes as described above (Step S52), each node may be stored in a hierarchical directory of XML documents and sub documents. A searchable index may be created to facilitate searching of the directory (Step S53). Each node may be indexed according to its attributes. For example, each node may be indexed according to its XML text, unique directory identifier, node element name, and/or any other attributes that may be listed within each node. For example, each node may be indexed according to its hierarchy.

The storing of the XML document and sub document nodes and the creation of an index may be carried out according to known techniques for storing information to a directory and creating a searchable index. For example, the techniques used for handling LDAP directories may be used to handle the creation of a searchable index.

The above directory may be searched for a particular XML document or sub document (Step S54). To facilitate the search, the created searchable index may be used. After the search has been performed, search results may be returned (Step S55). For example, the full XML text of the documents and/or sub documents resulting from the search may be displayed.

FIG. 6shows an example of a computer system which may implement the method and system of the present disclosure. The system and method of the present disclosure may be implemented in the form of a software application running on a computer system, for example, a mainframe, personal computer (PC), handheld computer, server, etc. The software application may be stored on a recording media locally accessible by the computer system and accessible via a hard wired or wireless connection to a network, for example, a local area network, or the Internet.

The computer system referred to generally as system1000may include, for example, a central processing unit (CPU)1001, random access memory (RAM)1004, a printer interface1010, a display unit1011, a local area network (LAN) data transmission controller1005, a LAN interface1006, a network controller1003, an internal buss1002, and one or more input devices1009, for example, a keyboard, mouse etc. As shown, the system1000may be connected to a data storage device, for example, a hard disk,1008via a link1002.

The above specific embodiments are illustrative, and many variations can be introduced on these embodiments without departing from the spirit of the disclosure or from the scope of the appended claims. For example, elements and/or features of different illustrative embodiments may be combined with each other and/or substituted for each other within the scope of this disclosure and appended claims.