[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




> -----Original Message-----
> From: Jari Urpalainen [mailto:jari.urpalainen at nokia.com]
> Sent: Friday, March 17, 2006 11:09 AM
> To: ext Thomson, Martin
> Cc: Burda Michal; simple at ietf.org
> 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: Michal.Burda at tietoenator.com
> [mailto:Michal.Burda at tietoenator.com]
> > > Sent: Wednesday, 15 March 2006 9:25 PM
> > > To: simple at ietf.org
> > > 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:presentity at example.com">
       <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:presentity at example.com">
       <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
Simple at ietf.org
https://www1.ietf.org/mailman/listinfo/simple