Subject: [Simple] XCAP: Fetching element namespaces and prefixes

From: Iñaki Baz Castillo <[email-masked]>
Date: Wed, 29 Jul 2009 21:10:57 +0200

Hi, as far as I understand by reading:
  http://tools.ietf.org/html/rfc4825#section-7.10
  http://tools.ietf.org/html/rfc4825#section-10

if a XCAP client wants to create/repalce an element, the body of the PUT 
request must use the same namespaces and prefixes as those used in the 
document stored in the server. But the URL in the PUT request could use custom 
prefixes if it includes a XMLNS query as usual ?xmlns(ccpp=urn...

So, if the client doesn't have a local cached version of the document (it 
doesn't know the namespace prefixes used in the stored document) it must fetch 
the element namespaces prior to the PUT operation.

So let's assume the document in the server uses the following namespaces:

  cp=urn:ietf:params:xml:ns:common-policy
  pr=urn:ietf:params:xml:ns:pres-rules

Let's suppose a query to fetch the namespaces for an element into the
document stored in the server:

----------
GET
/xcap-root/pres-rules/users/[email-masked]/pres-
rules/~~/ccpp:ruleset/ccpp:rule%5b@id=%22pres_whitelist%22%5d/ccpp:conditions/ccpp:identity/namespace::*
?xmlns(ccpp=urn:ietf:params:xml:ns:common-policy)
HTTP/1.1
---------------

It should retrieve from the server a reply containing the namespaces
and prefixes of the stored document for the element requested:
---------------
HTTP/1.1 200 OK
Content-Type: application/xcap-ns+xml

<cp:identity xmlns:pr="urn:ietf:params:xml:ns:pres-rules"
  xmlns:cp="urn:ietf:params:xml:ns:common-policy" />
----------------

With this data, the client could apply the correct namespace prefixes
to the body of a PUT request, this is: "cp" and "pr".

Is it correct? is the body of the response the correct one?

Thanks a lot.

-- 
Iñaki Baz Castillo <[email-masked]>