Subject: RE: [Simple] Re: A proposal for fixing the xcap schema problem and related issues

From: "Ramalakshmi V. Gunturi" <[email-masked]>
Date: Fri, 21 Oct 2005 14:21:08 +0530

HI,

As the Specification uses XML fragments that are not well formed (when used with namespaces), the standard parsers are causing problems.

I understand that using statically configured query was not a requirement in the specification, but looking from the development point of view if we have the support of static queries it gives us the advantage of having a cleaner code and easy adaptation to changes in protocols.  

For future releases can we look at the specification from this perspective and provide support for well formed xml fragments ??

Thanks & Regards,
Rama

-----Original Message-----
From: Jonathan Rosenberg [mailto:[email-masked]]
Sent: Friday, October 21, 2005 12:51 PM
To: Ramalakshmi V. Gunturi
Cc: [email-masked]
Subject: Re: [Simple] Re: A proposal for fixing the xcap schema problem
and related issues

inline.

Ramalakshmi V. Gunturi wrote:

> With reference to the earlier mail
> http://www1.ietf.org/mail-archive/web/simple/current/msg05810.html,
> 
> 
>>>>>>>>>>>>>>> Quoting from the earlier mail
>>>>>>>>>>>>>>> >>>>>>>>>>>>>.
> 
> 
> I would update the grammar of the node selector to allow for 
> namespace::*. Such a selector would select the namespace bindings in
>  scope for the element in question. xcap would define a format for 
> encoding those namespace bindings; basically, an xml fragment body
> with one element, the local name of the element in question, with
> xmlns and xmlns: attributes for each of the namespaces in scope,
> including the default.
> 
> For example, consider this document:
> 
> <?xml version="1.0" encoding="UTF-8"?> <rls-services
> xmlns="urn:ietf:params:xml:ns:rls-services" 
> xmlns:a="urn:ietf:params:xml:ns:resource-lists" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <service
> uri="sip:marketing at example.com"> <a:list name="marketing"> 
> <a:entry uri="sip:joe at example.com"/> <a:entry uri="sip:sudhir at
> example.com"/> </a:list> <packages> <package>presence</package> 
> </packages> </service> </rls-services>
> 
> The following query:
> 
> GET 
> http://xcap-root.com/rls-services/users/joe/~~/rls-services/service/namespaces::*
> 
> 
> would return:
> 
> <service xmlns="urn:ietf:params:xml:ns:rls-services" 
> xmlns:a="urn:ietf:params:xml:ns:resource-lists" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> 
> 
> This fixes the problem by allowing the client to get the in-scope 
> bindings, and cache them, so they can be used to interpret subsequent
>  GETs, and then used to create the namespace prefixes for elements in
>  subsequent PUTs. Of course, the client needs to be sure that the
> cached namespace bindings havent changed prior to the PUT; the
> mechanisms in section 7.10 of XCAP apply here as normal.
> 
> <<<<<<<<<<<<<< end quoting from earlier mail <<<<<<<<<<<<<<<<<
> 
> As per my understanding, the above approach needs the whole request
> formation part to be done at runtime. Please correct me If I am
> wrong.

Yes, you are right. I will note that allowing xcap operations to happen 
using a statically configured query (i.e., not computed at run time) has 
not been a requirement. I understand why you want to do it, but its not 
been a requirement to date.

The only two ways I know of, which would allow you to have a static 
query that will work are:

1. require standardized definitions for namespace prefixes
2. namespace bindings can already been includedin the request-URI. These 
are used only to define the in-scope bindings for evaluating the URI. 
Also apply them to the fragment in a PUT, and then have the server 
modify the namespace prefixes in the fragment to equal those defined for 
the same namespace URI.

#2 is really ugly, and violates the http spec itself (get(put(x))) won't 
equal X. #1 interacts poorly with non-standard extensions and violates 
the spirit of xml namespace, i think.

I welcome other proposals, but the one I propsoed was the best I could 
think of.

> 
> My question is that, If we want to identify and define the parameters
> that make up each request in a xml document, and then define another
> XSLT document to transform the request from the fomer XML document to
> an XCAP format, we will need to use standard parsers and
> transformers.
> 
> In this scenario, for put requests with xml fragments having
> namespaces,  the parser throws an error because in the payload there
> is no definition of namespace. ex: fergus wants to add foo to his
> accept list.
> 
> PUT
> http://xcap.example.com/services/org.openmobilealliance.poc-rules/users/sip:[email-masked]/pocrules/~~/cr:ruleset/cr:
> rule[@id="accept"]/cr:conditions/cp:identity/cp:entry?xmlns(cr="urn:ietf:params:xml:ns:commonpolicy")xmlns(cp="urn:oma:params:xml:ns:commonpolicy")
> HTTP/1.1
> 
> <cp:entry id="sip:[email-masked]" />
> 
> So when this payload in defined in the XSLT document and the XSL
> Transformer (javax.xml.transform.TransformerFactory) is used for
> generating the XCAP request, the transformer throws out an error
> saying "cp:entry not bound to parent", because as per the xml rules,
> the name space is not defined within the payload.

I don't quite follow this, so I can't tell if this is a problem with 
using this particular java library to generate the xcap query, or 
whether there is a protocol issue here. Can you clarify?

Thanks,
Jonathan R.

-- 
Jonathan D. Rosenberg, Ph.D.                   600 Lanidex Plaza
Director, Service Provider VoIP Architecture   Parsippany, NJ 07054-2711
Cisco Systems
[email-masked]                              FAX:   (973) 952-5050
http://www.jdrosen.net                         PHONE: (973) 952-5000
http://www.cisco.com

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: Jonathan Rosenberg <[email-masked]>
Date: Fri, 21 Oct 2005 13:51:47 -0400

Ramalakshmi V. Gunturi wrote:

> HI,
> 
> As the Specification uses XML fragments that are not well formed
> (when used with namespaces), the standard parsers are causing
> problems.

I'm confused. Why is it not well-formed? Well-formed requires matching 
opening and closing brackets. This is the case for all of the xml 
fragments, including the one in your example below. What am I missing?

> 
> I understand that using statically configured query was not a
> requirement in the specification, but looking from the development
> point of view if we have the support of static queries it gives us
> the advantage of having a cleaner code and easy adaptation to changes
> in protocols.

I don't see how these relate. Maybe we are not talking about the same 
thing. To me, "static queries" means that a client can be configured 
with a particular URI to use and a particular xml body to use in a PUT 
operation, with some kind of variable (like a buddy name), which it 
fills in). Thus, the client can't do generic xcap manipulations, it can 
just do an enumerated set of operations on the server that it cares 
about. This is beneficial since it means a client implementation of xcap 
can be done almost trivially, wihtout really even knowning what xcap is.

-Jonathan R.