> Unless you have multiple namespaces or are working with defined schema
> or something, it's useless boilerplate.
>
> It'd be a nice feature if ElementTree could let users optionally
> ignore a namespace, unfortunately it doesn't have it.
Yep. Exactly my point. Here's a link to the patch address
Carl Banks, 01.05.2010 12:33:
On Apr 29, 10:12 pm, Stefan Behnel wrote:
dmtr, 30.04.2010 04:57:
I don't want these "{http://www.very_long_url.com}"; in front of my
tags. They create performance disaster on large files
I seriously doubt that they do.
I don't know what kind of XML files you
On Apr 29, 10:12 pm, Stefan Behnel wrote:
> dmtr, 30.04.2010 04:57:
>
>
>
> > I'm referring to xmlns/URI prefixes. Here's a code example:
> > from xml.etree.cElementTree import iterparse
> > from cStringIO import StringIO
> > xml = """http://www.very_long_url.com";> > root>"""
> > for even
On Apr 27, 6:42 pm, dmtr wrote:
> Is there any way to configure cElementTree to ignore the XML root
> namespace? Default cElementTree (Python 2.6.4) appears to add the XML
> root namespace URI to _every_ single tag. I know that I can strip
> URIs manually, from every tag, but it is a rather idio
dmtr, 30.04.2010 23:59:
I think that's your main mistake: don't remove them. Instead, use the fully
qualified names when comparing.
Yes. That's what I'm forced to do. Pre-calculating tags like tagChild
= "{%s}child" % uri and using them instead of "child".
Exactly. Keeps you from introducing
Here's a link to the patch exposing this parameter:
http://bugs.python.org/issue8583
--
http://mail.python.org/mailman/listinfo/python-list
> I think that's your main mistake: don't remove them. Instead, use the fully
> qualified names when comparing.
>
> Stefan
Yes. That's what I'm forced to do. Pre-calculating tags like tagChild
= "{%s}child" % uri and using them instead of "child". As a result the
code looks ugly and there is extra
dmtr, 30.04.2010 04:57:
I'm referring to xmlns/URI prefixes. Here's a code example:
from xml.etree.cElementTree import iterparse
from cStringIO import StringIO
xml = """http://www.very_long_url.com";>"""
for event, elem in iterparse(StringIO(xml)): print event, elem
The output is:
endh
I'm referring to xmlns/URI prefixes. Here's a code example:
from xml.etree.cElementTree import iterparse
from cStringIO import StringIO
xml = """http://www.very_long_url.com";>"""
for event, elem in iterparse(StringIO(xml)): print event, elem
The output is:
end http://www.very_long_url.com}ch
dmtr, 28.04.2010 03:42:
Is there any way to configure cElementTree to ignore the XML root
namespace? Default cElementTree (Python 2.6.4) appears to add the XML
root namespace URI to _every_ single tag.
Certainly not in the serialised XML. Are you referring to the qualified
names it uses?
St
10 matches
Mail list logo