[lxml-dev] Ingore namespace when parsing
Sergio Monteiro Basto
sergio at sergiomb.no-ip.org
Fri May 1 22:31:35 CEST 2009
On Fri, 2009-05-01 at 10:41 -0700, Aaron Maxwell wrote:
> {{{
> # ns found from rootElement.nsmap as above
> rootElement.find('{' + ns + '}' + 'Child1')
> }}}
>
> will correctly find the child element.
>
> In this kind of situation, where I just want to parse the document and
> really don't care about the namespace, is there some way to construct
> a parser that will ignore it in a more automated way? Is there a
> simpler, better approach, or some insight I'm missing?
>
rootElement.xpath('//Child1')
--
Sérgio M. B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2192 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20090501/f67b3abd/attachment-0001.bin
More information about the lxml-dev
mailing list