Stefan Behnel added the comment:
Closing as a duplicate of the more general issue 18304.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> ElementTree -- provide a way to ignore namespace in tags and
searches
Martin Panter added the comment:
Also Issue 18304 for more discussion on simplifying namespaces
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
___
Florent Xicluna florent.xicl...@gmail.com added the comment:
See also issue 13378 which proposes custom namespace maps for serializing.
--
components: +XML
nosy: +eli.bendersky
versions: +Python 3.4 -Python 3.2
___
Python tracker
Stefan Behnel sco...@users.sourceforge.net added the comment:
I don't see this having much to do with the DRY principle. It's explicit is
better than implicit and better safe than sorry that applies here.
--
___
Python tracker rep...@bugs.python.org
Martin v. Löwis mar...@v.loewis.de added the comment:
I recommend to revert this change. It seems that some users are opposed to any
kind of folding (as my earlier folding experiment has demonstrated); users who
*really* don't want to see the history would need to step forward and request a
Changes by Martin v. Löwis mar...@v.loewis.de:
--
Removed message: http://bugs.python.org/msg137107
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
___
library.engine library.eng...@gmail.com added the comment:
What is so implicit in the passing of a list of undesired namespaces to the
parse function?
This is quite explicit, in my humble opinion, and it lets you not to repeat
yourself for each and every tag you want to find in the tree, as
library.engine library.eng...@gmail.com added the comment:
I second request for tag names not prefixed with a root namespace in python,
mostly because of ugly code, as performance degradation is negligible on
relatively small files. But this ubiquitous repeating (even in the case if
you're
Changes by Terry J. Reedy tjre...@udel.edu:
--
type: performance - feature request
versions: +Python 3.2 -Python 2.5, Python 2.6, Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
Stefan Behnel sco...@users.sourceforge.net added the comment:
There is at least one valid use case: code that needs to deal with HTML and
XHTML currently has to normalise the tag names in some way, which usually means
that it will want to remove the namespaces from XHTML documents to make it
Dmitry Chichkov dchich...@gmail.com added the comment:
I agree that the argument name choice is poor. But it have already been made by
whoever coded the EXPAT parser which cElementTree.XMLParser wraps. So there is
not much room here.
As to 'proposed feature have to be used with great care by
Dmitry Chichkov dchich...@gmail.com added the comment:
Interestingly in precisely these applications often you don't care about
namespaces at all. Often all you need is to extract 'text' or 'name' elements
irregardless of the namespace.
--
___
Fredrik Lundh fred...@effbot.org added the comment:
Namespaces are a fundamental part of the XML information model (both xpath and
infoset) and all modern XML document formats, so I'm not sure what problem
you're trying to solve by pretending that they don't exist.
It's a bit like modifying
Dmitry Chichkov dchich...@gmail.com added the comment:
This patch does not modify the existing behavior of the library. The
namespace_separator parameter is optional. Parameter already exists in the
EXPAT library, but it is hard coded in the cElementTree.XMLParser code.
Fredrik, yes,
New submission from Dmitry Chichkov dchich...@gmail.com:
The namespace_separator parameter is hard coded in the cElementTree.XMLParser
class disallowing the option of ignoring XML Namespaces with cElementTree
library.
Here's the code example:
from xml.etree.cElementTree import iterparse
Changes by Brian Curtin cur...@acm.org:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
___
___
Python-bugs-list mailing list
Changes by Dmitry Chichkov dchich...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file17153/issue-8583.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
___
Dmitry Chichkov dchich...@gmail.com added the comment:
And obviously iterparse can be either overridden in the local user code or
patched in the library. Here's the iterparse code/test code:
import cElementTree
from cStringIO import StringIO
class iterparse(object):
root = None
def
18 matches
Mail list logo