This ensures that the namespaces argument passed into PyQuery() will also be passed into any internally created copies. That allows you to set namespaces a single time rather than over and over.
Example before this pull:
namespaces = {'foo':'http://example.com/foo'}
d = pq(xml, parser='xml')
val = d('foo|bar', namespaces=namespaces).closest('foo|baz', namespaces=namespaces).children('foo|boo', namespaces=namespaces)
Example after this pull:
namespaces = {'foo':'http://example.com/foo'}
d = pq(xml, parser='xml', namespaces=namespaces)
val = d('foo|bar').closest('foo|baz').children('foo|boo')
Also added a couple of tests to ensure that namespaces are passed to copies.
This ensures that the
namespaces
argument passed intoPyQuery()
will also be passed into any internally created copies. That allows you to setnamespaces
a single time rather than over and over.Example before this pull:
Example after this pull:
Also added a couple of tests to ensure that namespaces are passed to copies.