case sensitivity and XML

Michal Wallace (sabren) sabren at manifestation.com
Sun May 21 18:12:56 EDT 2000


On Sun, 21 May 2000, Fredrik Lundh wrote:
 
> (tags can contain colons and dots -- and with namespaces, they
> can be complete URI's.  the 1.5.2 alphas didn't even support the
> start/end hooks; iirc, I added the compatibility code...)

Oh yeah! I started using xmllib on 1.5.1 on a machine without docs,
and found the 1.5.2 documentation quite confusing.. :)

 
> oh, you're still thinking that case-insensitive identifiers means
> that *all* string comparisitions should ignore case?  I'm pretty
> sure that wasn't what Guido had in mind...

Well, then some dict-like structures are case sensitive and some are
not. I could live with that, but I don't buy that it makes python
any easier to learn.

What about:


>>> class X:
...     def __setattr__(self, name, value):
...         print name, "=", value
...
>>> anX = X() # one way to handle the x=X() thing
>>> anX.a = 5
a = 5
>>> anX.A = 5
a = 5


.. There'd have to be a convention with __setattr__ that the value
always came in a certain case. You'd have to make all comparisons
using that case. Suppose the rule happens to be that it's converted
to lowercase. Then:

...     def __setattr__(self, name, value):
...         if name == "A":

   Is a bug, even if you type anX.A = 5 .. And probably a very hard
bug to notice! Again, you can teach around quirks like this, but is
that easier than teaching case sensitivity to begin with?


> > One option is to say that python just won't be able to parse some
> > XML documents. I think that would be suicide for the language, as
> > more and more people and companies start using XML.
> 
> well, start/end has never worked for all valid XML documents, so
> that's not much of an argument...


:) point taken.

I still haven't heard a solution to the Java/JPython problems.

Cheers,

- Michal
-------------------------------------------------------------------------
http://www.manifestation.com/         http://www.linkwatcher.com/metalog/
-------------------------------------------------------------------------





More information about the Python-list mailing list