parsing nested unbounded XML fields with ElementTree

Alister alister.ware at ntlworld.com
Tue Nov 26 05:41:14 EST 2013


On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote:

> On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico <rosuav at gmail.com>
> wrote:
> 
>> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell
>> <larry.martell at gmail.com>
>> wrote:
>> > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote:
>> >
>> >> First off, please clarify: Are there five corresponding </Node> tags
>> >> later on? If not, it's not XML, and nesting will have to be defined
>> >> some other way.
>> >
>> > Yes, there are corresponding </Node> tags. I just didn't show them.
>>
>> Good good, I just saw the "unbounded" in your subject line and got
>> worried :) I'm pretty sure there's a way to parse that will preserve
>> the current nesting information, but others can describe that better
>> than I can.
>>
>>
> The term 'unbounded' is used in the XML xsd file like this:
> 
> <xs:sequence maxOccurs="unbounded">
> 
> 
>> >> Secondly, please get off Google Groups. Your initial post is
>> >> malformed, and unless you specifically fight the software, your
>> >> replies will be even more malformed, to the point of being quite
>> >> annoying. There are many other ways to read a newsgroup, or you can
>> >> subscribe to the mailing list python-list at python.org, which carries
>> >> the same content.
>> >
>> > Not sure what you mean by malformed. I don't really care for Google
>> Groups,
>> > but I've been using it to post to this any other groups for years
>> > (since
>> rn
>> > and deja news went away) and no one ever said my posts were
>> > malformed. In any case, I did not know the group was available as a
>> > ML. I've subbed to that and will post that way.
>>
>> The mailing list works well for me too. Google Groups is deceptively
>> easy for a lot of people, but if you look through the list's archives,
>> you'll see that the posts it makes are unwrapped (and thus string out
>> to the right an arbitrary length), and all quoted text is
>> double-spaced, among other problems. Its users are generally unaware of
>> this, and like you are not maliciously inflicting that on us all, but
>> that doesn't make it any less painful to read :) Thanks for switching.
>>
>>
> I had noticed the double spacing and I always fixed that when I replied.
> <div dir="ltr">On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico <span
> dir="ltr"><<a href="mailto:rosuav at gmail.com"
> target="_blank">rosuav at gmail.com</a>></span> wrote:<br><div
> class="gmail_extra"><div class="gmail_quote">
> <blockquote class="gmail_quote" style="margin:0px 0px 0px
> 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-
left-style:solid;padding-left:1ex"><div
> class="im">On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell <<a
> href="mailto:larry.martell at gmail.com">larry.martell at gmail.com</a>>
> wrote:<br>
> 
> > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico
> wrote:<br>
> ><br>
> </div><div class="im">>> First off, please clarify: Are there five
> corresponding </Node> tags<br>
> >> later on? If not, it's not XML, and nesting will have to be
> defined<br>
> >> some other way.<br>
> ><br>
> > Yes, there are corresponding </Node> tags. I just didn't
> show them.<br>
> <br>
> </div>Good good, I just saw the "unbounded" in your subject
> line and got<br>
> worried :) I'm pretty sure there's a way to parse that will
> preserve<br>
> the current nesting information, but others can describe that better<br>
> than I can.<br></blockquote><div><br></div><div>The term
> 'unbounded' is used in the XML xsd file like
> this:</div><div><br></div><div><xs:sequence
> maxOccurs="unbounded"><br></div><div><br></div><blockquote
> class="gmail_quote" style="margin:0px 0px 0px
> 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-
left-style:solid;padding-left:1ex">
> 
> <div class="im"><br>
> >> Secondly, please get off Google Groups. Your initial post
> is<br>
> >> malformed, and unless you specifically fight the software,
> your<br>
> >> replies will be even more malformed, to the point of being
> quite<br>
> >> annoying. There are many other ways to read a newsgroup, or you
> can<br>
> >> subscribe to the mailing list <a
> href="mailto:python-list at python.org">python-list at python.org</a>, which
> carries<br>
> >> the same content.<br>
> ><br>
> > Not sure what you mean by malformed. I don't really care for
> Google Groups,<br>
> > but I've been using it to post to this any other groups for
> years (since rn<br>
> > and deja news went away) and no one ever said my posts were
> malformed. In<br>
> > any case, I did not know the group was available as a ML. I've
> subbed to<br>
> > that and will post that way.<br>
> <br>
> </div>The mailing list works well for me too. Google Groups is
> deceptively<br>
> easy for a lot of people, but if you look through the list's
> archives,<br>
> you'll see that the posts it makes are unwrapped (and thus string
> out<br>
> to the right an arbitrary length), and all quoted text is<br>
> double-spaced, among other problems. Its users are generally unaware<br>
> of this, and like you are not maliciously inflicting that on us all,<br>
> but that doesn't make it any less painful to read :) Thanks for<br>
> switching.<br><span class=""><font
> color="#888888"><br></font></span></blockquote><div><br></div><div>I had
> noticed the double spacing and I always fixed that when I replied.
>  </div></div><br></div></div>


if you could now change your male client to send in plane text only we 
would not get this duplicated HTML copy of the post which is just as 
annoying as the double spacing form GG (probably more so).


-- 
<KnaraKat> Bite me.
* TheOne gets some salt, then proceeds to nibble on KnaraKat a little
         bit....



More information about the Python-list mailing list