[XML-SIG] Questions about lxml/ElementTree
Dave Kuhlman
dkuhlman at rexx.com
Thu Jun 7 22:34:02 CEST 2007
I'm using lxml and ElementTree. I like them.
I do have a couple of questions:
1. When I get the tag for a node (element) using node.tag, I see
something like this::
{http://xxxx.com/ns/yyyy}zzzz
The stuff inside curly brackets is the namespace. I don't need
that, so I use a regular expression to strip it off.
My question is -- Is there a way to get the tag (element name)
without a namespace. I'll feel silly at some time in the
future after writing lots of code that strips the namespace
if I find that there is an easier way.
2. When I use lxml, I call method node.getparent(). But, ElementTree
elements do not support the getparent method. I'd like to
suggest that it be added. How should I do that.
Thanks for help.
Dave
More information about the XML-SIG
mailing list