[XML-SIG] SAX Namespaces

Fred L. Drake, Jr. fdrake@beopen.com
Thu, 6 Jul 2000 21:39:22 -0400 (EDT)


tpassin@home.com writes:
 > Well, if you don't know what attributes to expect - like you don't have a
 > DTD and you want to display an more-or-less unknown document - you want to
 > iterate over the attributes.  If you know what attributes you want,

  When iterating over these unknown attributes, do you care that you
see them in their original order?  If so, then a sequence is
*required*, and anything else can be derived (somewhat annoying but
possible).  If you don't care about the *original* order, .items() on
a mapping is sufficient.
  Paul:  Are there reasonable cases where you need the original order?
(You seem to be the strongest proponent of this.)  Would this be
something where modality in the interface isn't so bad?  You get
sequences if you ask for them, but mappings by default?

 > As Paul and Greg have mentioned, it's easy to get a list if you have a
 > dictionary.  I've changed my mind on this one - I used to think a list was
 > the right idea.  But now I say a dictionary would be good.  I don't see it
 > as being bad either way, though.

  I think there are a couple of issues: is it reasonable to require
the original order of atttributes, and, if not, what's the right
dictionary key?  (I'd say (URI,localname) in namespace mode, or
rawname otherwise, with all other information available in the value.)
xml.sax.AttributeList can provide all the appropriate query methods
according to the SAX spec at that point.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at beopen.com>
BeOpen PythonLabs Team Member