Re: Svar: Re: [xml] XPath problem with namespaces



Erik F. Andersen wrote:
Thanks,
that was it. I knew I knew it, there was just too much info at once ;-) But why can't it simply register all the namespaces from the document itself in xmlXPathNewContext?

Because there's no way to predict which prefix will be used in the instance (you can even use a default namespace). So you have to bind the prefix that you will use in the xpath expression, and it can be different from the prefix in the document.

 HTH

        Fabrice
--
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
http://www.francetelecom.com/rd



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