Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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="test@bjk.com.tr"/> . 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="test@bjk.com.tr"/>



<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: 28289
95
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 ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic