Questions about lxml/ElementTree

Dave Kuhlman <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
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

   

_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.