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

AW: [xml] XPath evaluation



Hi, 

> Auftrag von Fabrice Desré - France Telecom R&D/MAPS/AMS 
> CAPRON Patrick wrote:
> > I have tried with the use of xmlXPathRegisterNs, but it 
> doesn't work.
> > xmlXPathRegisterNs(xpathCtx, BAD_CAST 
> "urn:ssp.ApplicationHeader$ahV10", BAD_CAST "")
> > xmlXPathRegisterNs(xpathCtx, BAD_CAST 
> "urn:ssp.pm.GetAccount$camt.003.001.02", BAD_CAST "")
> > xmlXPathRegisterNs(xpathCtx, BAD_CAST "SwInt", BAD_CAST "")
> > 
> > It has the same behaviour...
> > /REQUEST/RequestPayload/Document doesn't work
> > /REQUEST/RequestPayload/*[name()='Document'] works fine
> 
>   The second query works because 'Document' is the name if the 
> element... If you use local-name() instead it wont work anymore.

The results of name() and local-name() are the same in this case, since
the element "Document" has a namespace prefix of NULL; so local-name()
should work. Actually using name() is more a bit of a problem, since
if the element "Document" had the namespace prefix "foo", one would
need to test for name() = 'foo:Document'.

Regards,

Kasimier



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