Re: Getting elements and text with lxml

2008-05-17 Thread J . Pablo Fernández
On May 17, 4:17 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > J. Pablo Fernández wrote: > > I have an XML file that starts with: > > > > > > > > >   *-a > > > > > out of it, I'd like to extract something like (I'm just showing one > > structure, any structure as long as all data is there is fi

Re: Getting elements and text with lxml

2008-05-17 Thread Stefan Behnel
J. Pablo Fernández wrote: > I have an XML file that starts with: > > > > > *-a > > > out of it, I'd like to extract something like (I'm just showing one > structure, any structure as long as all data is there is fine): > > [("ofc", "*"), "-", ("rad", "a")] >>> root = etree.fromstring(

Re: Getting elements and text with lxml

2008-05-17 Thread John Machin
J. Pablo Fernández wrote: On May 17, 2:19 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Fri, 16 May 2008 18:53:03 -0300, J. Pablo Fernández <[EMAIL PROTECTED]> escribió: Hello, I have an XML file that starts with: *-a out of it, I'd like to extract something like (I'm just sh

Re: Getting elements and text with lxml

2008-05-17 Thread J . Pablo Fernández
On May 17, 2:19 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 16 May 2008 18:53:03 -0300, J. Pablo Fernández <[EMAIL PROTECTED]>   > escribió: > > > > > Hello, > > > I have an XML file that starts with: > > > > > > > > >   *-a > > > > > out of it, I'd like to extract something li

Re: Getting elements and text with lxml

2008-05-16 Thread Gabriel Genellina
En Fri, 16 May 2008 18:53:03 -0300, J. Pablo Fernández <[EMAIL PROTECTED]> escribió: Hello, I have an XML file that starts with: *-a out of it, I'd like to extract something like (I'm just showing one structure, any structure as long as all data is there is fine): [("ofc", "*"), "-",

Getting elements and text with lxml

2008-05-16 Thread J . Pablo Fernández
Hello, I have an XML file that starts with: *-a out of it, I'd like to extract something like (I'm just showing one structure, any structure as long as all data is there is fine): [("ofc", "*"), "-", ("rad", "a")] How can I do it? I managed to get the content of boths tags and the text u