[MRG+1] support namespace prefix in xmliter_lxml #963
Conversation
@@ -2,18 +2,18 @@ | |||
from scrapy.selector import Selector | |||
|
|||
|
|||
def xmliter_lxml(obj, nodename, namespace=None): | |||
def xmliter_lxml(obj, nodename, prefix='x', namespace=None): |
pablohoffman
Dec 2, 2014
Member
why not add the prefix
as the last argument (to maintain backwards compatibility with positional arguments)?
why not add the prefix
as the last argument (to maintain backwards compatibility with positional arguments)?
tpeng
Dec 3, 2014
Author
Contributor
because it's called prefix
:), so i thought it's better put it before the namespace
because it's called prefix
:), so i thought it's better put it before the namespace
pablohoffman
Dec 5, 2014
Member
It doesn't sound like a strong enough reason to break backwards compatibility, I'm happy to merge if you leave prefix
argument after namespace
.
It doesn't sound like a strong enough reason to break backwards compatibility, I'm happy to merge if you leave prefix
argument after namespace
.
@tpeng I wonder why are you using this code. We have some evil plans to remove it from Scrapy (see #1063), or to move it to some other place. But I'm not familiar enough with xmliter_lxml - is it really better than scrapy.utils.iterators.xmliter? If so, does it make sense to move it to scrapy.utils.iterators? Or maybe even use it by default? |
@kmike sorry for the delay. the original reason was i found the |
See also: #605 which introduces a third way to parse XML iteratively in Scrapy. |
+1 to merge it. |
[MRG+1] support namespace prefix in xmliter_lxml
No description provided.