70 likes | 147 Views
Jari Urpalainen Nokia Research Center 6.11.2004. Partial PIDF format-02. PIDF diff. “run diff, apply patch” model, i.e. this format patches the full PIDF document which is always the reference allowed operations: add, remove and replace which are applied in the given order.
E N D
Jari Urpalainen Nokia Research Center 6.11.2004 Partial PIDF format-02
PIDF diff • “run diff, apply patch” model, i.e. this format patches the full PIDF document which is always the reference • allowed operations: add, remove and replace which are applied in the given order. • create not allowed • two attributes within root node <pidf-diff>: “version” and “entity”.
XPath selections • ABNF syntax is a restricted set of XPath 1.0 • namespace expansion similar to XCAP • namespace uri for a certain prefix is searched from the current document context • if location step has no prefix and a corresponding element with default namespace found == match • selectors point to single elements, attributes and text-node contents • relative location paths • location step conditions contain: attribute value comparisons, text-node content comparisons and positional constraints
PIDF diff operations • <add> • two selectors: “parent” and “sel” • “parent” is used to select a node from the current document. New content is then added onto this found node. • “sel” is used to point to the newly created node. This is used to define e.g. an attribute name or it has to contain a positional constraint if multiple children exist • depending on the “sel” value, the content of <add> element is either plain text or an xml-fragment enclosed with CDATA
PIDF diff operations • <replace> • one attribute: “sel” is used to point to the node the content of which is going to be updated. • content of <replace> same as with <add> • <remove> • one attribute: “sel” is used to point to the node to be deleted.
Error handling • It is an error if any of the add, remove or replace operation fails -> fall back to the full PIDF • PN client can then refresh the subscription • PP server rejects the request with error code and the client retries with full PIDF
<?xml version="1.0" encoding="UTF-8"?> <pidf-diff xmlns="urn:ietf:params:xml:ns:pidf-diff" entity="pres:someone@example.com" version="1"> <add parent="presence" sel="*[4]"> <![CDATA[<tuple id="ert4773"> <status> <basic>open</basic> </status> <contact priority="0.4">mailto:pep@example.com</contact> <note xml:lang="en">This is a new tuple</note> </tuple>]]></add> <replace sel="presence/tuple[@id="r1230d"]/status/basic/text()">open</replace> <remove sel="presence/tuple[@id="r1230d"]/status/rs:activity"/> <remove sel="presence/pe:person/pe:status/rs:activities/rs:activity[.="busy"]"/> <replace sel="presence/tuple[@id="cg231jcr"]/contact/@priority">0.7</replace> </pidf-diff> Examples