[XML-SIG] python-xml unsupported?

John W. Shipman john at nmt.edu
Tue Feb 12 23:15:22 CET 2008


On Feb 11, 2008, at 10:58 AM, Bob Kline wrote:
+--
| Are there any plans to include the XML validation support in the
| standard Python libraries at some point?
+--

On Tue, 12 Feb 2008, Fred Drake replied:
+--
| I don't know of any such plans at this time.  Most programmers aren't
| actually in need of schema-based validation most of the time, though
| there are clearly times when it would be handy.  Even then, however,
| getting programmers to agree as to what's needed doesn't result in a
| single clear set of requirements, mostly due to the variety of schema
| languages available; everyone needs something different.
+--

Minor details aside, I'd like to point out that validation is
a pretty open-ended process, and no canonical validator can
handle all possible needs.

For example, suppose you have a 'part-number' attribute that
is not truly valid unless it is defined in your organization's
part number database.  Do you expect XSchema to go out and
peer into the database?  I think that's terribly unreasonable.

The xsd: datatypes from XSchema that I use in my Relax NG
schemas[^1] are perfectly adequate for well over 90% of my
validation needs.  The rest of them have to be covered by
my Python application anyway.

For me, one of the big payoffs of validating XML files as they
are input is that it eliminates a lot of error-checking logic
from my application.  I never have to worry, 'what if this
attribute is missing or isn't a valid number?'  I can just
grab the attribute and coerce it with int().

May I suggest that if there is some validating parser added
to the library, stick with a basic set of content types that
cover the vast majority of needs.  Careful applications
coders will not mind the additional overhead of validating
the rest.

Best regards,
John Shipman (john at nmt.edu), Applications Specialist, NM Tech Computer Center,
Speare 119, Socorro, NM 87801, (505) 835-5950, http://www.nmt.edu/~john
   ``Let's go outside and commiserate with nature.''  --Dave Farber
---------------
[^1] http://www.nmt.edu/tcc/help/pubs/rnc/
esp. http://www.nmt.edu/tcc/help/pubs/rnc/xsd.html


More information about the XML-SIG mailing list