Coercion dynamique

Giuseppe Castagna Giuseppe.Castagna at
Mon Jul 7 14:48:12 CEST 2003

Until devel is not ready (for the moment there are just two persons on
it) let me switch our conversation on users at

On Mon, 2003-07-07 at 11:59, Stefano Zacchiroli wrote:
> On Mon, Jul 07, 2003 at 11:28:59AM +0200, Giuseppe Castagna wrote:
> > > I think validation (intended as Schema validation) should be kept
> > > separate from loading. Almost all real life application I've seen using
> > > XML don't even use DTD for validating documents, because validating
> > > against a DTD is an expensive operation. Schemas are even more rare than
> > > DTDs for the same reason.
> > All real life applications don't use types, so ...
> This is not true, all the large XML application I've worked use types
> (they were written in OCaml), but don't use any kind of "automatic"
> validation on the XML, nor DTD nor SChema. All "validations" where
> performed by hand.

I meant they do not use XML types.

> If you would like CDuce success on those areas, you should consider this
> fact and permit the programmer to use typed XML documents only where he
> want them.
> I think the world isn't ready for too much typed XML documents :-)))

Yes but the few persons that are ready should be given the tools to use
it. So all in all I guess that what I proposed before is still valid,

> Ok, we can add all the syntactic sugar we like, but IMO the default
> behaviour for loading should be just to check well formedness
> constraints.

Ok let it be the default behavior. So NO DEFAULT VALIDATION or checking
when loading a document (the loaded document has type Any). But I still
think that it is very important, at least for testing purposes, to have
the checking (or the validation? your opinion guys) on the
document. So for instance we can keep the load_xml as before but make
its behavior context dependent, that is when we have

validate load_xml "URI" as T 

then it behaves as I have described for load_xml("URI",T). Namely when
parsing the file it also checks the types (at least) or even validate it
(that is, if possible it converts strings into Ints, dates, or whatever,
if the type T requires it)

Alternatively we can make this behavior more explicit by adding

load_validate "URI" with T

So (as we discussed) for the last two choices the system should execute
in parallel calls to pxp (or expat) and to the typing automata and fail
as soon as possible by returning the point of the document that caused
the failure.


More information about the Cduce-users mailing list