[OpenSIPS-Users] [OpenXCAP]how to add new element for resource-lists?

Saúl Ibarra Corretgé saul at ag-projects.com
Tue Jan 4 14:36:38 CET 2011


Hi,

On 4/1/11 10:42 AM, CheeWii wrote:
> Hi,
> I have test to add new new element for resource-lists,just as follows:
> <?xml version="1.0" encoding="utf-8"?>
> <resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists">
> <list name="0" xmlns="urn:ietf:params:xml:ns:resource-lists">
> <display-name>Friends</display-name>
> <entry uri="1417"
> xmlns="urn:ietf:params:xml:ns:resource-lists"><display-name>I</display-name><other>http://www.blog.com</other></entry>
> </list>
> <list name="1" xmlns="urn:ietf:params:xml:ns:resource-lists">
> <display-name>Show Buddylist</display-name>
> </list>
> </resource-lists>
> But there is many errors when I put the resource-lists to the OpenXCAP:
> debian:~/syn_showuser# xcapclient -i buddylist.ini put --account-name=1417
> put
> http://xcap.bupt.edu/xcap-root/resource-lists/users/sip:1417@sip6.edu.cn/index
> 409 Conflict
> content-type: application/xcap-error+xml;charset=utf-8
> content-length: 369
> <?xml version="1.0" encoding="UTF-8"?>
> <xcap-error
> xmlns="urn:ietf:params:xml:ns:xcap-error"><schema-validation-error><!--
> <string>:5:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element
> '{urn:ietf:params:xml:ns:resource-lists}other': This element is not
> expected. Expected is ( ##other{urn:ietf:params:xml:ns:resource-lists}* ).
> --></schema-validation-error></xcap-error>
> I think this may be caused by the unsupport element, and I have read the
> RFC4826, still don't know how to add a new element .

You can't just add an element wherever you want :-) You need to check 
the XML schema and see if the element supports extensions, and if it 
does, then you can add whatever you want but you'll need to define a 
custom namespace for the elements you added.

-- 
Saúl Ibarra Corretgé
AG Projects



More information about the Users mailing list