Abstract:
A method of managing an Extensible Markup Language (XML) document is provided. The method includes a XML server receiving the request of XML document management operation sending from the XML Document Management (XDM) client. The request carries the document identifier and the state information. The XDM server changes the state of the document corresponding to the document identifier to the state that corresponding to the state information.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    The present application is a continuation application of PCT application No. PCT/CN2007/070275, filed Jul. 11, 2007, which claims benefit of Chinese application No. 200610063281.0, filed Oct. 24, 2006. Both PCT application No. PCT/CN2007/070275 and Chinese application No. 200610063281.0 are incorporated by reference. 
     
    
     FIELD 
       [0002]    The present embodiments relate to an Extensible Markup Language (XML) technique, and particularly to an XML document management method, an XML document management system, an XML document management client, and an XML document management server. 
       BACKGROUND 
       [0003]    The XML document management (X Data Model) system is a universal enabler for various communication services, and is capable of storing and managing the data of various services. The Open Mobile Alliance (OMA) has established a preliminary specification for the XML document management. The XML document management is implemented via the XML Configuration Access Protocol (XCAP). 
         [0004]    The XCAP resource includes an XML document, or an element or an attribute in an XML document. The XCAP resource is identified by an XCAP Uniform Resource Identifier (URI). One XCAP URI corresponds to one XML document, one element in an XML document, or an attribute in an XML document. The common data in an XML document includes the elements and the attributes of the XML document. An XDM client (XDMC) makes use of an XML document in the XML server (XMLS) through XCAP operations, and should construct the URI of a resource on which an operation is requested on the basis of a method of application. At present, the XDMC may perform the following general operations on an XML document in the XMLS: Creation or replacement of a document, deletion of a document, retrieval of a document, creation or replacement of an element, deletion of an element, retrieval of an element, creation or replacement of an attribute, deletion of an attribute, and retrieval of an attribute. For details of the XCAP, a reference may be made to the specification of “The Extensible Markup Language (XML) Configuration Access Protocol” of the Internet Engineering Task Force. 
         [0005]    The XDMS provides the functions of operation authentication on an XML document, XML document management, XML document change notification, etc. For example, a shared XDMC stores URI list documents shared by users. A URI list includes, for example, a group, an acceptance list, or a denial list as reused by different service enablers. 
         [0006]    The XML system only supports general operations on XML documents. The XDMC can only perform general operations on the XML documents. Accordingly, an XDMC that controls the XML documents flexibly and comprehensively is desired. 
       SUMMARY 
       [0007]    The present embodiments may relate to an Extensible Markup Language (XML) technique. For example, in one embodiment, an XML document management method, system, client, or server enables the XDMC to manage XML documents flexibly, comprehensively, and effectively. 
         [0008]    In one embodiment, an XML document management method includes receiving, by an XDMS, an XML document management operation request sent from an XDMC, the request carrying a document identifier and state information; and modifying, by the XDMS, the state of the document corresponding to the document identifier to the state corresponding to the state information. 
         [0009]    In another embodiment, an XML document management system includes an XDMC and an XDMS. The XDMC is adapted to send an XML document management operation request to the XDMS, with a document identifier and state information carried in the request. The XDMS is adapted to modify the state of the document corresponding to the document identifier to the state corresponding to the state information. 
         [0010]    In another embodiment, an XML document management client includes a message constructing unit and a message transmitting unit. The message constructing unit is adapted to construct an XML document management operation request. A document identifier and state information are carried in the request. The message transmitting unit is adapted to send the XML document management operation request to the XDMS. 
         [0011]    An XML document management server includes a receiving unit and a processing unit. The receiving unit is adapted to receive an XML document management operation request from an XDMC. The XML document management operation request carries an document identifier and state information. The processing unit is adapted to receive the XML document management operation request from the receiving unit, and modify the state of the document corresponding to the document identifier to the state corresponding to the state information. 
         [0012]    The present embodiments have the following advantageous effects: 
         [0013]    1) Because the state information of the document is carried in the XML document management request sent to the XDMS by the XDMC, the XDMS can change the state of the document, so that the state of the document is achievable as required by the XDMC. 
         [0014]    2) Because the state of the document changes (e.g. the state of the document changes to suspend), the XDMC and the XDMS can not perform general operations on the document. Therefore, the XDMC can control the XML document completely, and manage the XML document more conveniently. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]      FIG. 1  is a flow diagram of the XML document management method; 
           [0016]      FIG. 2  is a flow diagram of obtaining the state information of a document; and 
           [0017]      FIG. 3  is a structural diagram of the XML document management system. 
       
    
    
     DETAILED DESCRIPTION 
       [0018]      FIG. 1  is a flow diagram of the XML document management method according to an embodiment. The method includes the following processes: 
         [0019]    Process  101 . The XDMC sends an XML document management operation request to the XDMS, with a document identifier and state information carried in the request. 
         [0020]    Process  102 . The XDMS obtains the current state information of the document corresponding to the document identifier, and determines whether the current state information is consistent with the state information carried in the request. If the current state information is consistent with the state information carried in the request, the XDMS terminates the process; otherwise the XDMS performs process  103 . This process is optional. 
         [0021]    Process  103 . The XDMS changes the current state information of the document in accordance with the state information carried in the request. 
         [0022]    The state information includes a suspended state, a resume state, and other states set by the XML document management system. The XML document management method is described as follows in the case that the state information is the suspend state and the resume state respectively. 
         [0023]    The state information of a document is the attribute information of the document, i.e. additional information of the document, or, in other words, the metadata of the document, which is highly correlated to the document itself (e.g. the creation time of the document). With metadata introduced into a document, the document includes metadata of the document and common data of the document. The metadata of the document is some data describing additional information of the document. A document may contain several types of metadata. For example, the creation time of the document and the owner of the document can be taken as the metadata of the document. The main difference between the metadata and common data of the document is that the metadata of the document describes the attributes of the document, and is usually maintained by the XDMS and can not be changed by the XDMC freely, while the common data of the document may be changed by the XDMC freely. 
         [0024]    Storing XML documents in the XDMS may include recording XML documents in tables in a database. Each record in a table generally includes the following fields: 
         [0025]    User ID (designed to identify the owner of an XML document), document name, creation time, document version tag (E Tag), or other information related to the user identification. 
         [0026]    For implementing document suspend/resume operation, a field describing the state of the document is added in the record. If a suspend operation is performed on the document, the value of the field is set to “inactive”, indicating the document is in a suspended state. If a resume operation is performed on the document, the value of the field is set to “active”, indicating the document is in an active state. However, to implement document suspend/resume operations via the XCAP protocol, the metadata IDs (also referred to as access IDs) in the document should be determined, so as to access the metadata of the document by means of the metadata IDs, and implement document state control (e.g. suspension or resumption) by modifying the information in the metadata of the document. If an operation is to be performed on the document, the XDMC sends an XCAP message containing the metadata ID (Request-URI) of the document, to specify the XCAP resource to be accessed, in other words, the metadata information of the XML document to be accessed. For example, the value of a Request-URI may be: 
         [0027]    http://xcap.example.com/resource-lists/users/sip.joe@example.com/index 
         [0028]    Two examples of document metadata representation method are described below. 
       EXAMPLE 1 
       [0029]    A Request-URI is set in a specified format to specify the location information of the metadata of the XML document to be accessed. The Request-URI includes the following parts: 
         [0030]    XCAP Root: It is a context containing all application documents of all users managed by the XCAP server, such as the http://xcap.example.com in the above example. 
         [0031]    Document Selector: It includes a series of path segments, each of which is separated with a “/” mark. A Document Selector specifies an XML document in the XCAP root. 
         [0032]    Metadata Selector Separator: A “˜˜@” mark is used in the embodiment of the present invention, in order to differentiate from the node selector in the XCAP protocol. Indeed, other appropriate marks may be used. 
         [0033]    Metadata Selector: It specifies a specific metadata in a selected document, for example, “state” may be used as the metadata selector for the state of a selected document. 
         [0034]    Because of the fact that the metadata information may be in a simple data format or a complex XML format, the Request-URI that is used to access the metadata of an XML document may further include the following additional parts: 
         [0035]    In the above example, the Request-URI parameter that specifies the document state of the metadata of the document titled “index” is as follows: 
         [0000]    
       
         
               
               
             
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 http://xcap.example.com/resource-lists/resource-lists/users/ 
               
             
          
           
               
                   
                 sip:joe@example.com/index/~~@/state 
               
               
                   
                   
               
             
          
         
       
     
       EXAMPLE 2 
       [0036]    The document state information may be stored in a separate XCAP resource document. The relationship between the XCAP URI of an XML document and the XCAP URI of the state information of the XML document is as follows: 
         [0037]    The XCAP URI of document state information includes the corresponding XCAP URI of the XML document suffixed with “.state”. 
         [0038]    For example, the XCAP URI of an XML document is: 
         [0000]    
       
         
               
               
             
               
             
           
               
                   
                   
               
             
             
               
                   
                 http://xcap.example.com/resource-lists/users/sip:joe@example.com/ 
               
             
          
           
               
                 index 
               
               
                   
               
             
          
         
       
     
         [0039]    The XCAP URI of the state information of the document is: 
         [0000]    
       
         
               
               
             
               
             
           
               
                   
                   
               
             
             
               
                   
                 http://xcap.example.com/resource-lists/users/sip:joe@example.com/ 
               
             
          
           
               
                 index.state 
               
               
                   
               
             
          
         
       
     
         [0040]    For implementing a suspension operation on a document, the state information of the document as described in process  101  is “inactive”. 
         [0041]    In process  103 , the XDMS performs the following in accordance with the state information of the document obtained in process  102 . If the current state information of the document is “active”, the XDMS modifies the state information of the document to “inactive”, and returns an operation success message to the XDMC. If the current state information of the document is “inactive”, the XDMS keeps the current state information of the document, and returns an operation failure message to the XDMC. 
         [0042]    Similarly, for implementing a resumption operation on a document, the state information of the document as described in process  101  is “active”. 
         [0043]    In process  103 , the XDMS performs the following in accordance with the state information of the document obtained in process  102 : If the current state information of the document is “active”, the XDMS keeps the current state information of the document, and returns an operation invalid message to the XDMC; if the current state information of the document is “inactive”, the XDMS modifies the state information of the document to “active”, and returns an operation success message to the XDMC. 
         [0044]    If an XDMC performs a suspension operation on a document, the XDMC sends an XML document suspension operation request to the XDMS. If the XDMS returns a success response message, it indicates that the document in the XDMS was originally in an “active” state, and is in a “suspend” state presently. If the XDMS returns an error indication message, it indicates that the document in the XDMS was originally in a “suspend” state and is still in a “suspend” state presently. Similarly, if an XDMC performs a resumption operation on a document and the XDMS returns a success response message, it indicates that the XDMS document was originally in a “suspend” state and is in an “active” state presently; otherwise it indicates that the document in the XDMS was originally in an “active” state and is still in an “active” state presently. 
         [0045]    In addition to obtaining the current state of a document by the type of the message returned in above operations, the current state value of a document may be carried in the message body or a specified header field of the error indication message. A returned message includes several parts, one is message type, and some others are header fields. The message type is a number. Each header field includes two parts of a header field name and a header field value. A number of the message type may be specified to represent the current state of the document. Or, a header field may be used to represent the current state of the document, and different values of the header field can represent different states. 
         [0046]    The XDMC may obtain the state information of the document before initiating a suspension or resumption operation on the document. If the obtained current state information of the document is identical to the state of the document required by the XDMC, the XDMC does not need to initiate any operation on the state information of the document. 
         [0047]    If the metadata including the state information of a document is stored in a separate XML file, the XDMC obtains the state of the document with the method shown in  FIG. 2 . The detailed process is as follows: 
         [0048]    Process  201 : The XDMC initiates a request for obtaining the state information of a document to the separate XML document. The request is that the XDMC constructs an access ID of the document that stores the state information of the document in accordance with the access ID of the document of which the state is to be obtained. Specifically, the XDMC attaches a “.state” suffix to the access ID of the document of which the state is to be obtained. 
         [0049]    Process  202 : The XDMS returns the current state information of the document to the XDMC in accordance with the request message. 
         [0050]    Therefore, it can be seen that if the XDMC obtains the current state of the document in advance and the current state of the document is the state required by the XDMC, the XDMC does not have to initiate a suspension or resumption request. Therefore, the process is simpler. 
         [0051]    An embodiment of the suspension operation on a document is described as follows: 
         [0052]    The XDMC sends a suspension request that the XDMC first sends a suspension request message to the XDMS. The suspension request message is a message in the XCAP protocol. The Request-URI parameter in the message is described as above. The suspension request message is as follows by example of the Request-URI described at the end of the above paragraph: 
         [0000]    
       
         
               
               
             
               
             
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 PUT 
               
             
          
           
               
                 http://xcap.example.com/resource-lists/resource-lists/users/ 
               
               
                 sip:joe@example.com/index/~~@/state HTTP/1.1 
               
             
          
           
               
                   
                 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ) 
               
               
                   
                 Host: xcap.example.com 
               
               
                   
                 Inactive 
               
               
                   
                   
               
             
          
         
       
     
         [0053]    The “Inactive” in the suspension request message is the message body. 
         [0054]    If the state information is stored in a separate XML document, the suspension request message is as follows: 
         [0000]    
       
         
               
             
               
               
             
               
               
             
           
               
                   
               
             
             
               
                 PUT 
               
             
          
           
               
                   
                 http://xcap.example.com/resource-lists/users/sip:joe@example.com/ 
               
               
                   
                 index.state HTTP/1.1 
               
             
          
           
               
                   
                 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; 
               
               
                   
                 Windows NT 5.1; ) 
               
               
                   
                 Host: xcap.example.com 
               
               
                   
                 &lt;?xml version=“1.0” encoding=“UTF-8”?&gt; 
               
               
                   
                 &lt;state&gt;inactive&lt;/state&gt; 
               
               
                   
                   
               
             
          
         
       
     
         [0055]    If the separate document further includes contents (e.g. Access information) besides the state information &lt;state&gt;, only the state information is modified with a PUT method as follows: 
         [0000]    
       
         
               
               
             
               
             
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 PUT 
               
             
          
           
               
                 http://xcap.example.com/resource-lists/users/sip:joe@example.com/ 
               
               
                 index.state/~~/state HTTP/1.1 
               
             
          
           
               
                   
                 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; ) 
               
               
                   
                 Host; xcap.example.com 
               
               
                   
                 inactive 
               
               
                   
                   
               
             
          
         
       
     
         [0056]    2. When checking the Request-URI, the XDMS first finds the XML document corresponding to the parameter first. On finding a metadata selector separator, the XDMS locates the metadata in accordance with the metadata selector and checks the content of the current metadata first (here the metadata is the state information of the document), and then performs as follows in accordance with the state information of the document: 
         [0057]    If the state value of the document is “active”, the XDMS checks the message body part of the request message. If the content of the message body is “inactive”, the XDMS modify the state of the document to “inactive”, and returns an operation success indication message as follows: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 HTTP/1.1 200 OK 
               
               
                   
                 Connection: close 
               
               
                   
                   
               
             
          
         
       
     
         [0058]    If the state value of the document is “inactive” and the requested operation is invalid, the XDMS returns a failure message: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 HTTP/1.1 403 Forbidden 
               
               
                   
                 Connection: close 
               
               
                   
                   
               
             
          
         
       
     
         [0059]    An embodiment of a resumption operation on a document may be implemented as follows: 
         [0060]    1. The XDMC sends a resumption request: The XDMC first sends a resumption message to the XDMS. The message is a message in the XCAP protocol. The Request-URI parameter in the message has been described as above. The resumption request message is as follows by example of the Request-URI described at the end of the above paragraph: 
         [0000]    
       
         
               
               
             
               
               
             
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 PUT 
               
             
          
           
               
                   
                 http://xcap.example.com/resource-lists/resource-lists/users/ 
               
               
                   
                 sip:joe@example.com/index/~~@/state HTTP/1.1 
               
             
          
           
               
                   
                 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; 
               
               
                   
                 Windows NT 5.1; ) 
               
               
                   
                 Host: xcap.example.com 
               
               
                   
                   
               
             
          
         
       
     
         [0061]    2. The XDMS processes the resumption request: On receiving the above request, the XDMS first finds the XML document corresponding to the parameter during the checking of the Request-URI; on finding a metadata selector separator, the XDMS locates the metadata in accordance with the metadata selector and first checks the content of the current metadata (here the metadata is the state information of the document). In this case: 
         [0062]    If the obtained state of the document is “active”, the resumption request is valid, and the XDMS sends an appropriate response message. For example, the XDMS may send an appropriate response message as follows: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 HTTP/1.1 403 Forbidden 
               
               
                   
                 Connection: close 
               
               
                   
                   
               
             
          
         
       
     
         [0063]    If the obtained state of the document is “inactive”, the resumption request is valid, the XDMS modifies the state of the document to “active”, and returns an operation success indication message: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 HTTP/1.1200 OK 
               
               
                   
                 Connection: close. 
               
               
                   
                   
               
             
          
         
       
     
         [0064]    It can be seen from the above technical solution that the state information of a document is carried in the XML document management request sent to the XDMS by the XDMC, so that the XDMS can change the state of the document. Accordingly, the state of the document is achievable as required by the XDMC. In addition, because the state of the document changes (e.g. the state of the document changes to suspend), the XDMC and the XDMS can not perform general operations on the document, thereby the XDMC can control the XML document completely, and manage the XML document more conveniently. Moreover, the XDMC can obtain the current state of the document in advance; if the current state of the document is the state required by the XDMC, the XDMC does not need to initiate a suspension or resumption request, thereby making the process to be simpler. 
         [0065]      FIG. 3  is a structural diagram of the XML document management system according to an embodiment. 
         [0066]    The XDMC is adapted to send an XML document management operation request to the XDMS, with a document identifier and state information carried in the request. The XDMC includes a message constructing unit  301  and a message transmitting unit  303 . The message constructing unit is adapted to construct an XML document management operation request carrying a document identifier and state information. The message transmitting unit is adapted to send the XML document management operation request to the XDMS. 
         [0067]    The XDMS is adapted to modify the state of the document corresponding to the document identifier to the state corresponding to the state information. The XDMS includes a receiving unit  307 , a processing unit  305 , an obtaining unit  309 , and a determining unit  311 . The receiving unit  307  is adapted to receive an XML document management operation request carrying a document identifier and state information from the XDMC; the obtaining unit  309  is adapted to obtain the current state information of the document corresponding to the document identifier, and transmit the current state information to the determining unit  311 . The determining unit  311  is adapted to determine whether the current state information is consistent with the state information in the XML document management operation request, and send an initiation instruction to the processing unit  305  if the current state information is not consistent with the state information in the XML document management operation request. The processing unit  305  is adapted to receive the XML document management operation request from the receiving unit  307 , and modify the state of the document corresponding to the document identifier to the state corresponding to the state information. 
         [0068]    In the technical solutions of document management, the state information of an XML document is carried in the XML document management request sent to the XDMS by the XDMC, so that the XDMS can change the state of the XML document, thereby the state of the document is achievable as required by the XDMC. Because the state of the XML document changes (e.g. the state of the document changes to suspend), the XDMC and the XDMS can not perform general operations on the XML document, thereby the XDMC can control the XML document flexibly, completely and effectively, and can manage the XML document more conveniently. 
         [0069]    It is apparent for those skilled in the art that a variety of modifications and alternations to the present invention can be made without departing from the spirit and scope of the present invention. If the modifications and alternations fall into the scope of the claims or equivalents of the claims, the present invention intends to cover the modifications and alternations.