WebSphere brand IBM WebSphere XML Document Management Server, Version 7.0

Adding and editing elements

Using a node selector statement in the XCAP URI, you can select elements to be added or edited in an existing document.

Before you begin
Before using the XDMS client and XCAP requests, make sure that you have JDK1.6.0 SR 3 installed and configured in your system path variables.
About this task
Create or edit an XDM document of your choice, or use the TestListElement.xml document located in the was_root/installableApps/xdms/clients/samples directory and add it to the system using the xcap_put.sh command.
Note: was_root is the installation root directory for WebSphere® Application Server Network Deployment. By default, this directory is:
  • AIX /usr/IBM/WebSphere/AppServer
  • Linux /opt/IBM/WebSphere/AppServer

  1. Create an xml document containing a new element and save it. For example:
    <?xml version="1.0" encoding="UTF-8"?>
    <list name="coworkers" xmlns="urn:ietf:params:xml:ns:resource-lists" xmlns:oau="urn:oma:xml:xdm:resource-list:oma-appusage">
            <display-name>Co-Workers</display-name>
            <entry uri="sip:employee1@example.com">
                    <display-name>Employee #1</display-name>
            </entry>
            <entry uri="sip:employee2@example.com">
                    <display-name>Employee #2</display-name>
            </entry>
    </list>
  2. From the command line type: cd was_root/installableApps/xdms/client/ to reach the command client.
  3. Type the XCAP PUT request.
    ./xcap_put.sh -user user_id -password password -filename file_name -content_type application/xcap-el+xml XCAP_URL/~~/root_element/element[@attributename="attributevalue"]
    Note: This is one example of a Node Selector. Refer to IETF RFC 4825 for information about other ways to specify a Node Selector for an element.
    For example:

    To post the sample TestListElement.xml into the TestResourceList.xml document on the XDMS server for xdms1@us.example.com, type the following parameters on a single line:

    ./xcap_put.sh -filename samples/TestListElement.xml -user sip:xdms1@us.acme.com -password xdms1password -content_type application/xcap-el+xml 'http://west109.rtp.raleigh.ibm.com:9081/services/resource-lists/users/sip:xdms1@us.example.com/TestResourceList.xml/~~/resource-lists/list[@name="coworkers"]'
  4. Run the command to send the request. The new content will now appear in the specified document.



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.