Ticket #137 (closed defect: invalid)

Opened 5 months ago

Last modified 5 weeks ago

XmlXPathSelector error with xmlns

Reported by: luciferleo Owned by: pablo
Priority: major Milestone:
Component: code Version: 0.8
Keywords: Cc: daniel pablo

Description

Please see code below. If the node has an attribute xmlns XmlXPathSelector will fail.

In [106]: XmlXPathSelector(text=ur'<?xml version="1.0"?><feed xml="rss"><entry>b</entry></feed>').select('//entry')
Out[106]: [<XmlXPathSelector (entry) xpath=//entry>]

In [115]: XmlXPathSelector(text=ur'<?xml version="1.0"?><feed xmlns="rss"><entry>b</entry></feed>').select('//entry')
Out[115]: []

Change History

Changed 5 months ago by pablo

  • priority changed from blocker to major

Changed 5 weeks ago by pablo

  • status changed from new to closed
  • resolution set to invalid

This is not a bug with selectors. The xmlns attribute changes the semantics by declaring that the node belongs to a different XML namespace. Consider using XmlXPathSelector.register_namespace() method.

Note: See TracTickets for help on using tickets.