[standards-jig] NEW: Packet Filtering (JEPs 0062, 0063, 0064)

Fabrice Desré fabrice.desre at francetelecom.com
Wed Dec 18 15:41:20 UTC 2002

Hello all,

A few remarks about the XPath filtering JEP 
(http://www.jabber.org/jeps/jep-0064.html) :

1) The condition is said to be true if the XPath expression returns one 
or more nodes. What about XPath expression that return a string, a 
number or a boolean ?
My proposal is to use the boolean value of the XPath expression's 
result, by using appropriate casting if necessary (see §4.3, 

2) Jabber heavily uses namespaces, and while XPath is namespace-capable, 
it's not so straightforward. Indeed, there is no concept of default 
namespace in XPath. This means that the XPath expression 
/message/subject will match elements that are not namespace-qualified, 
but not elements that appears to be scoped by a default namespace 
In order to access namespace-qualified nodes, you have to bind a prefix 
to the namespace's URI (this is implementation dependant) and use this 
prefix in the XPath expression. So /message/subject becomes 
/jab:message/jab:subject, if I bound the jab prefix to the jabber:client 
This implies that a) the examples in the JEP are incorrect (well, they 
are valid XPath, but will not work as expected), and b) that the JEP 
must provide a wayto bind prefixes to URI.
Something like this could be used :
<xpath xmlns='http://jabber.org/protocol/filter/xpath'>
   <ns pfx='jab'>jabber:client</ns>

3) What is the evaluation context for the expressions ? The examples 
implies that the real root of the jabber stream is not considered, and 
that each packet is a document on his own. Am I right ?
This leads again to some namespace issues, since namespaces declared on 
the <stream:stream/> element will no more be available. I'd rather 
evaluate the expression against a document formed by the real root and 
the current packet.

Fabrice Desré
France Télécom R&D/DTL/TAL
Tél: +(33) (0)2 96 05 31 43
Fax: +(33) (0)2 96 05 39 45

More information about the Standards mailing list