Professional Documents
Culture Documents
Jonathan Rosenberg
Ground Rules
• This is a session for level setting
– People are at different points
– We will start from the beginning
• NO QUESTION IS TOO STUPID
• Disrespect will not be tolerated
• Please interrupt and ask
– PLEASE!
Agenda
• Understanding XML • XCAP Basics
– Basic XML Concepts
– Namespaces
– Schema
– XPath in Brief
• HTTP Concepts of
Note
– Etags
• XCAP Problem
Definition
XML Basics
• XML is a mechanism for <?xml version="1.0" encoding="UTF-8"?>
representing structured <address-book>
<!—This guy is a bozo --
data <entry>
• Data is represented by a <name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
tree <postal>
<street paved=“true”>600 Lanidex Pl</street>
• Each node in the tree is <city>Parsippany</city>
an element <state>NJ</state>
<country>USA</country>
• Elements have attributes </postal>
<ietf-participant/>
– Attributes qualify the data
</entry>
• “Leaf” Elements can </address-book>
element[@name=“value”]
• foo/bar[@attr=“1”]
• foo/bar[@attr=“2”]
• foo/bar[@stuff=“LOTR”]
Selecting Elements
• The result of selecting • XPath allows
an element includes selecting multiple
– The element elements
– Its children – XCAP does not use
– Its attributes this feature
– Everything between
open bracket of open
element to close
bracket of close
element
Selecting Attributes
• An attribute is
selected by prefixing <foo>
<bar attr=“1”>Hi</bar>
its name with an “@” <bar attr=“2” bool=“y”>How</bar>
• foo/bar[1]/@attr <movie stuff=“LOTR”>Are</bar>
</foo>
• foo/bar[@attr=“2”]/
@bool
• foo/movie/@stuff
• The selected object is
JUST the value
– Different from elements
– Name would be redundant
XCAP Problem Space
• Motivating use cases
– Buddy Lists
– Authorization Policies
– Hard state presence data
Buddy List Use Case
Subscribe List
extension
• Server retrieves list Write
List
associated with buddylist
URI Data
Manipulation
– Generates SUBSCRIBEs to Server
them
Standard Ifaces
• Client can manage that list
– Add, remove, modify entries
Client
Authorization Use Case
Subscribe Petri
Client
Hard State Presence Management Subscribe Petri
• Hiroshi subscribes to
Petri Notify
• Same as previous
pictures
Not
• Scope limited to client to Standardized
XCAP server
• Access from Network App Not
could be XCAP Standardized
– Acts as a client
• There may be no network XCAP
Server
app
– XCAP server is repository
for client data XCAP
Client
The Big “Aha”
• XCAP is about clients getting, deleting and
putting pieces of hierarchically organized data
• Ideally XCAP should leverage technologies
widely found in phones, PCs and other client
devices
• XCAP can just BE HTTP, by defining the URI
hierarchy to extend into “web documents”
• HTTP URIs can represent any resource
– Don’t need to exist on a disk
– Interpretation is up to the server
• XCAP defines that interpretation
HTTP in Brief
• Clients invoke methods on server
– GET – retrieve content
– PUT – place content
– POST – pass data to a process
– HEAD – get meta-data, not content
– OPTIONS – query server for capabilities
– DELETE – remove a resource from a server
• Requests and responses contain bodies
Fetch a document
<foo>
<bar attr=“1”>Hi</bar>
<bar attr=“2” bool=“y”>How</bar>
<movie stuff=“LOTR”>Are</bar>
</foo>
XCAP Scope
• Application Usages
– Details how you use XCAP for a new app (i.e., CPCP)
– Server assigned data
• Naming convention for URIs
– Document selector – picks the “XML Document” based on a
defined document hierarchy
– Component selector – picks an element or attribute within the
document
• Using GET, PUT and DELETE for management of
elements and attributes
• Error content
• Extensibility of data
• Etag advice
Application Usage
• Defines what an application needs to do to be
used with XCAP
– Define an Application Unique ID
– Define the XML Schema for the data
– Define data semantics
– Specify naming conventions – binding between
application and XCAP
– Data interdependencies (aka server computed data)
– Authorization policies
AUID
• Unique Identifier for each application
• Two sub-namespaces
– IETF tree: tokens in RFC documents
• IANA Registry
– Vendor tree: proprietary data
• Start with reverse DNS name of enterprise
• Examples
– IETF Tree
• “resource-lists” draft-ietf-simple-xcap-list-usage
• “pidf-manipulation” draft-isomaki-simple-xcap-pidf-manipulation-
usage-00
• “rules” draft-rosenberg-simple-rules
– Vendor Tree
• “com.example.customer-list”
AUID Grammar
AUID 1 AUID 2
users global
petri hiroshi
doc1 dir1
Example 1
• http://xcap.example.com/address-
book/users/petri/adbook1/address-book/entry/name
adbook1
<?xml version="1.0" encoding="UTF-8"?>
<address-book>
<!—This guy is a bozo --
<entry>
<name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
<postal>
<street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
<state>NJ</state>
<country>USA</country>
</postal>
<ietf-participant/>
</entry>
</address-book>
Client Operations
• Retrieving • Modifying
– Document – Document
– Element – Element
– Attribute – Attribute
• Deleting • Adding
– Document – Document
– Element – Element
– Attribute – Attribute
KEY CONSTRAINT
Can only affect one element, attribute
or document at a time
Fetching a Document
GET http://xcap.example.com/address-book/users/petri/adbook1 HTTP/1.1
adbook1
<?xml version="1.0" encoding="UTF-8"?>
<address-book>
<!—This guy is a bozo --
<entry>
<name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
HTTP/1.1 200 OK <postal>
Content-Type: application/adbook+xml <street paved=“true”>600 Lanidex Pl</street>
Content-Length: … <city>Parsippany</city>
<state>NJ</state>
<?xml version="1.0" encoding="UTF-8"?> <country>USA</country>
<address-book> </postal>
<!—This guy is a bozo -- <ietf-participant/>
<entry> </entry>
<name>Jonathan Rosenberg</name> </address-book>
<email>jdrosen@dynamicsoft.com</email>
<postal>
<street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
<state>NJ</state>
<country>USA</country>
</postal>
<ietf-participant/>
</entry>
</address-book>
Fetching an Element
GET http://xcap.example.com/address-book/users/petri/adbook1/
address-book/entry/name HTTP/1.1
adbook1
<?xml version="1.0" encoding="UTF-8"?>
<address-book>
<!—This guy is a bozo --
<entry>
<name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
HTTP/1.1 200 OK <postal>
Content-Type: application/xml-fragment-body <street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
Content-Length: … <state>NJ</state>
<country>USA</country>
</postal>
<name>Jonathan Rosenberg</name> <ietf-participant/>
</entry>
</address-book>
Fetching an Attribute
GET http://xcap.example.com/address-book/users/petri/adbook1/
address-book/entry/street/@paved HTTP/1.1
adbook1
<?xml version="1.0" encoding="UTF-8"?>
<address-book>
<!—This guy is a bozo --
<entry>
<name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
HTTP/1.1 200 OK <postal>
Content-Type: application/xml-attribute-value <street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
Content-Length: … <state>NJ</state>
<country>USA</country>
</postal>
true <ietf-participant/>
</entry>
</address-book>
Delete a Document
DELETE http://xcap.example.com/address-book/users/petri/adbook1 HTTP/1.1
adbook1
<?xml version="1.0" encoding="UTF-8"?>
<address-book>
<!—This guy is a bozo --
<entry>
<name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
HTTP/1.1 200 OK <postal>
<street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
<state>NJ</state>
<country>USA</country>
</postal>
<ietf-participant/>
</entry>
</address-book>
NULL
Deleting an Element adbook1
<?xml version="1.0" encoding="UTF-8"?>
DELETE <address-book>
<!—This guy is a bozo --
http://xcap.example.com/address-book/user <entry>
s/petri/adbook1/ <name>Jonathan Rosenberg</name>
<email>jdrosen@dynamicsoft.com</email>
address-book/entry/name/email HTTP/1.1 <postal>
<street paved=“true”>600 Lanidex Pl</street>
<city>Parsippany</city>
<state>NJ</state>
<country>USA</country>
</postal>
<ietf-participant/>
</entry>
</address-book>