[XML-SIG] Some thoughts about types libraries

Eric van der Vlist vdv@dyomedea.com
16 Sep 2002 16:10:12 +0200


As candidates for type libraries interfaces, we have right now:

1) The work started by Andrew with feedback from Thomas Passin:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyxml/sandbox/datatypes/

2) An "extremely simplistic" version which I am currently using in XVIF:

http://downloads.xmlschemata.org/python/xvif/rngCoreTypeLib.py

in which right now, a type has only a constructor (which performs any
canonicalization and syntactical checks) and a isEqual() method.

Both are going more or less in the same direction and I am wondering if
this the right way to go...

What could be objected to these two proposals is that they model XML
datatypes as if they were something very different from other classes
(including built-in python types).

This is true that some datatypes defined by W3C XML Schema have no
direct equivalent in Python, but this is not always the case and I am
wondering if:

a) when there is a mapping (for instance xs:integer is a signed integer
of arbitrary lenght ie the same thing than a python "long"), we
shouldn't use this fact and implement the corresponding datatypes as a
subclass of the python native type
b) when it's not the case we shouldn't consider adding methods to make
it something which can be used out of the scope of XML validation.

I am not sure to be very clear and it's rather abstract and fuzzy to
explain, but I think that there is a difference between designing a type
library which could only be used in the context of XML validations and a
type library which could eventually be usefull "standalone" by
applications needing to manipulate the abstract objects represented by
the datatype library.=20

Eric
--=20
Rendez-vous =E0 Paris.
                          http://www.technoforum.fr/integ2002/index.html
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------