[Python-ideas] Let's be more orderly!

Don Spaulding donspauldingii at gmail.com
Wed May 15 22:36:10 CEST 2013


On Wed, May 15, 2013 at 3:01 PM, <random832 at fastmail.us> wrote:

> Hang on, what?
>
> Now, maybe that's true of your _particular_ XML spec. And this certainly
> seems symptomatic of a larger problem (e.g. firing off an event as soon
> as the action tag closes, rather than parsing the whole document). But
> XML elements are _not_ unordered.
>

Hmm, when I ran across this particular problem, I recall seeing somewhere
that the preservation of element order in the spec is undefined.  And
indeed it appears that while attributes are called explicitly as not having
significant order, the spec doesn't actually weigh in on element order one
way or another.  However, regardless of what's in the spec, it would seem
that everyone just assumes element order to be significant anyway, so it
doesn't really matter.

http://lists.xml.org/archives/xml-dev/200101/msg00841.html


> On Wed, May 15, 2013, at 15:35, Don Spaulding wrote:
> > Twice
> > now I've encountered poorly-written web services that have choked on
> > something like:
> >
> > <request>
> >   <action>modifyStuff</action>
> >   <user>user_123456</user>
> > </request>
> >
> >  ...with an error to the effect of "Cannot modifyStuff without specifying
> > user credentials".  So someone else has built a system around an XML
> > parser
> > that doesn't know that sibling elements aren't guaranteed to appear in
> > any
> > particular order.
>
> --
> Random832
> (top-posted because my reply and your message aren't guaranteed to
> appear in any particular order.)
>

>>> OrderedDict(I='see', what='you', did='there')
OrderedDict([('did', 'there'), ('I', 'see'), ('what', 'you')])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130515/68eeee83/attachment.html>


More information about the Python-ideas mailing list