• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Question about inserting element with xPath

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody,

I have a resource list in XCAP server. And i want to add new entry for the list (rcs_pnb_chat_blockedusers). When i sent following xpath and put xml body content, rcs_pnb_chat_blockedusers is modifying with <entry uri="[email protected]"/> . I don't want to modify existing entry, i want to add a new entry. Is there a something wrong with my xpath request ?

PUT "$XPATH_ROOT/John/resource-list/~~/resource-lists/list%5B@name=%22rcs_pnb_chat_blockedusers%22%5D/entry"
..
Content-Type: application/xml-fragment-body
..
..
<entry uri="[email protected]"/>



<resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists">
<!-- The list of blocked contacts -->
<list name="rcs_blockedcontacts">
<display-name>My blocked contacts</display-name>
</list>

<list name="rcs_pnb_chat_blockedusers">
<display-name>My chat blacklist</display-name>
<entry uri="tel:+123456"/>
</list>

<list name="rcs_pnb_ft_blockedusers">
<display-name> My file transfer blacklist </display-name>
</list>

</resource-lists>




Best Regards
 
Marshal
Posts: 28425
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know anything about that server or how it supports requests, but my observation is only this: An XPath expression refers to an existing node (or nodeset) of an XML document. The concept of an XPath expression for a nonexistent element -- well, there is no such concept.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@alp carsikarsi
You then should make the node-selector be a no-match, try this ?
 
reply
    Bookmark Topic Watch Topic
  • New Topic