Re: [xml] Using Xpath with default namespace and null prefix

El Lunes, 8 de Febrero de 2010, François Delyon escribió:
Unfortunatelly it's common in XCAP protocol and applications as the  
above example.

But as far as I understand XCAP, it is possible to use regular XPath  
expression by providing a namespace-prefix pair  in the request part  
of the URL.

Yes, but it could occur the same as in the example I provided. A XML document 
contains a reference to other node of same or different document:

  <external anchor=""; />

Then the client knows that the default namespace for the application is 
"urn.default" so it must transform the above Xpth segment into:

  xpath( "/ns:root/ns:child", "ns"=>"urn.default" )

For this, the client must do a dirty parsing of the Xpath expression.

In fact, I don't understand why XCAP does not simply use XPointer.

SIP/XCAP RFC's are mostly written by non real developers, so they don't care 
how easy are these specifications to implement. In fact, by adding some 
"extra-non-useful-but-cool" features on top of an existing specification the 
RFC author seems to "provide some added value..."  :(

Iñaki Baz Castillo <ibc aliax net>

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