Subject: RE: [Simple] Filtering: the purpose of the 'ns-binding' element

From: <[email-masked]>
Date: Fri, 17 Mar 2006 11:32:26 +0100

> -----Original Message-----
> From: Jari Urpalainen [mailto:[email-masked]]
> Sent: Friday, March 17, 2006 11:09 AM
> To: ext Thomson, Martin
> Cc: Burda Michal; [email-masked]
> Subject: RE: [Simple] Filtering: the purpose of the 'ns-binding'
element
> 
> On Wed, 2006-03-15 at 15:06 -0600, ext Thomson, Martin wrote:
> > I think that it is not only redundant, but dangerous.  It is
possible to
> have contradictory values in there and in the xmlns:... attributes.  I
> can't think of a good reason to include such an element in this
context.
> >
> > > -----Original Message-----
> > > From: [email-masked]
> [mailto:[email-masked]]
> > > Sent: Wednesday, 15 March 2006 9:25 PM
> > > To: [email-masked]
> > > Subject: [Simple] Filtering: the purpose of the 'ns-binding'
element
> > >
> > > Hi,
> > >
> > > each filter-set document may contain the 'ns-binding' element.
> > > Considering that the XML document itself has the means of defining
> > > namespace abbreviations (xmlns attributes), I do not completely
> > > understand the purpose of this element.
> > >
> > > Could anyone explain the importance of the 'ns-binding' element?
Isn't
> > > it redundant? Why it doesn't suffice to extract namespace
> abbreviations
> > > from the xmlns attributes?
> > >
> > > Thanks, in advance.
> > >
> > > Regards,
> > >
> > > Michal Burda
> > >
> The subscriber is not typically aware nor need to be aware about the
> used prefixes of published presence information. These prefixes are
thus
> used for XPath evaluations during filtering, i.e. expanding the names
> within 'xpath' attribute values of <include> and <exclude> elements.
One
> could argue that it were simpler just to use in-scope namespaces of
> those elements of filter document (just like in xml-patch-ops) but it
is
> only a matter of taste. As such they are certainly needed. Using
> published presence document context here is not right. Still one
option
> is to use "namespace-uri()" and "local-name()" functions but it leads
to
> ugly looking and long rules. Default namespace is handled similarly to
> XPath 1.0, i.e. a selector "foo" locates a unqualified <foo> element.
> 
> br,
> Jari

I think I was misunderstood. When I wrote "...xmlns attribute" above, I
meant the attribute of the XML document contained in the body of the
SUBSCRIBE request, not the presence document that is stored in presence
server.

In the speech of examples, my question was, why do we need to write:

<filter-set xmlns="urn:ietf:params:xml:ns:simple-filter">
     <ns-bindings>
       <ns-binding prefix="pidf" urn="urn:ietf:params:xml:ns:pidf"/>
     </ns-bindings>
     <filter id="123" uri="sip:[email-masked]">
       <what>
         <include type="xpath">
           /pidf:presence/pidf:tuple/pidf:status/pidf:basic
         </include>
       </what>
     </filter>
   </filter-set>

...while we can equivalently write this:

<filter-set xmlns="urn:ietf:params:xml:ns:simple-filter"
            xmlns:pidf="urn:ietf:params:xml:ns:pidf">
     <filter id="123" uri="sip:[email-masked]">
       <what>
         <include type="xpath">
           /pidf:presence/pidf:tuple/pidf:status/pidf:basic
         </include>
       </what>
     </filter>
   </filter-set>

(please note the 'xmlns:pidf' attribute of the 'filter-set' element)...?

In the latter example, we use standard XML feature of namespace bindings
without the need to introduce a new element 'ns-bindings'.

Regards,

Michal

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

---

From: Jari Urpalainen <[email-masked]>
Date: Fri, 17 Mar 2006 15:01:36 +0200

> SUBSCRIBE request, not the presence document that is stored in presence
ok, sorry, my false interpretation.

> without the need to introduce a new element 'ns-bindings'.
Certainly I'd prefer using in-scope namespaces (because they are
cleaner, filter documents were shorter etc.). However, this means quite
many changes to these i-d's and the current <ns-bindings> aren't buggy,
i.e. they do work although they don't look nice. Also this new format
should then specify how default namespaces are handled, similar to
xml-patch-ops, XCAP, XPath 1.0 or XPath 2.0 ?, and this means once
again, some more text (and probably some dispute on the model chosen). 
br,
Jari

---

From: Hisham Khartabil <[email-masked]>
Date: Fri, 17 Mar 2006 20:30:44 +0100

Jari, your first response was correct. I don't what you are talking 
about in this response :)

Michal, you have misinterpretted the ns-binding. You cannot use the 
in-scope namespace to be used in the <include> element. It has a value 
of string. Well, you can, but its ugly and confusing. Typically 
namespaces are used for the XML document element themselves and not for 
the values on the xml elements that just happened to have xpath 
expressions.

Hisham