Title: XCAP
1 XCAP
- Jonathan Rosenberg
- Cisco Systems
2History
- -07 was IESG approved and now in RFC-ED queue in
normative hold on xcap-diff - Several small bugs reported against XCAP and a
major issue raised on namespace fragments in PUT - How to know namespace prefixes in content of
body? - Proposal on list to
- Yank from queue (not done yet)
- Revise and republish to
- Fix minor bugs reported
- Address extensibility issue
- Fix namespace problem
3Changes in -08
- Added URI extensibility
- There in principle previously unknown URI
would be rejected with 404 - Still true, but URI grammar now has hooks
- Negotiation of extensions through existing
xcap-caps mechanism - Added namespace selector from xpath for
learning namespaces
4Example
Client
Server
lthello xmlnsNS1gt ltthis xmlnsbarNS2gt
ltbaris xmlnstestNS3/gt lt/thisgt lt/hellogt
GET http//doc//hello/this/bar/namespace
ltbaris xmlnsNS1 xmlnsbarNS2
xmlnstestNS3/gt
Only GET Allowed!
5Additional Changes
- Clarified 200 vs. 201
- 201 on Creation
- 200 on Insertion
- URI reference to 3986
- Clarified SHOULD NOT escape code , but
normalization happens for comparison (ref 3986) - Removed schema-instance declarations
- Clarified insertion rules relative to other
elements, comments and whitespace earliest last - After the last element with the same name, but
before any other elements, but after any
whitespace/comments
6Example
ltrootgt ltel1 att"first"/gt ltel1 att"second"/gt
lt!--comment --gt ltel2 att"first/gt lt/rootgt
ltrootgt ltel1 att"first"/gt ltel1 att"second"/gt
lt!--comment --gt ltel1 att"third"gtltel2
att"first/gt lt/rootgt
PUT root/el1_at_attthird ltel1 att"third"/gt
7Changes
- Document selector configuration simplified
- XUI SIP AOR for SIP applications
- Single document usages, doc is called index
- Sub-directories not recommended
- Cannot have document and subdirectory with same
name
8Pros/Cons of Namespace Proposal
- Client needs to do a GET to obtain namespaces in
scope at insertion point and THEN do a PUT with
new content - Need to worry about namespace bindings changing
between GET and PUT - Can cache bindings, though
- Cannot construct static PUTs
- i.e., map a UI command add buddy to an HTTP PUT
with a URI that is a function of the usage,
filled in with template data from UI
9Alternative Proposals for GET
- Use Canonical XML
- Instead of getting namespace bindings, those
bindings are returned as a result of a normal GET
anyway
10Example
lt?xml version"1.0" encoding"UTF-8"?gt ltfooroot
xmlnsfoo"ns1" xmlnsbar"ns2"gt ltfooelementgt
ltbarelementgt ltbarchild attr"value"
battr"value" xmlnsb"ns3"/gt lt/barelementgt
lt/fooelementgt lt/foorootgt
GET ..//root/element/
ltfooelement xmlnsbar"ns2" xmlnsfoo"ns1"gt
ltbarelement gt ltbarchild xmlnsb"ns3"
attr"value" battr"value"gt lt/barchildgt
lt/barelementgt lt/fooelementgt
11Canonical Example Pros/Cons
- Unfortunately changes nothing for PUT still
need to do GET first, still issues with
conditional PUT - A little cleaner
- Getting an element and its namespaces happens in
one shot, BUT no way to get JUST namespaces
problem for elements with many children - Does GET(PUT(X)) X?
- Depends on equality from XML perspective I
believe so - Requires XCAP server to do canonicalization in
all GET responses
12Making the PUT Easier
- Proposal 1 An app usage can require namespace
prefixes to be hashes of namespace URI - Makes all prefixes well-known
- No referential integrity problem, unlike
namespace prefix munging - But kind of kludgey
- Proposal 2
- PUT bodies contain namespace declarations dont
depend on in-scope bindings - Will pollute document with lots of redundant
binding declarations, but otherwise works with
existing spec
13Recommendation
- Reject canonical XML approach
- Requires getting all elements to just get
namespace bindings - Go for proposal 2 for blind insertions
- Document this use case
- But, we still have a problem with blind
insertions on simultaneous writers
14The Insertion Problem in XCAP
- XCAP is fundamentally about mapping XML
components to resources - In current spec, if an element or attribute
doesnt exist in the document, neither does its
corresponding HTTP resource - This is the natural definition
- Big drawback an insertion is a resource creation
and thus resource had no etag - Makes it impossible to do conditional insertions
- This was a conscious group choice, but it is
proving to be a huge practical mess
15Implications of Unconditional Insertions
- XCAP server needs to return what document etag
was prior to insertion - Requires normative reference to xcap-diff
- If this doesnt match client copy, client needs
to - Undo its change
- Do a PUT to repair document
- Deal with possibility that this PUT might fail
- Criticisms on this problem continue
16Proposed Change
- An HTTP resource if its parent exists in the
document - If the parent exists in the document but the
component doesnt, the resource is considered
empty - A GET of it would return a document with no
content - Kind of hokey
- But, all element insertions end up being HTTP
modifications, not creations, so etags can be
used - Eliminates the need for xcap-diff at all as part
of xcap core