Why I want XPDL for DOAML's XMLNS representation

[Follow-up of this post]

I think I know what I want to do on this page. I want an XHTML summary of DOAML, as provided in its DOAP document, informations about the ontology, extracted from the OWL data present in the RDFS, and finally, a quick list of the classes and properties defined by DOAML, and maybe some data I provide in XHTML - with, of course, the "look'n'feel" of the rest of the DOAML website.

I can make it using a Makefile, that will generate each chunk of data, ie apply stylesheets on the RDFS and the DOAP documents in order to generate XHTML documents, then put them along in the final XHTML document using XInclude, without forgetting to <link /> DOAML website's CSS, and pass it through tidy.

But... well, call me an <xml:geek/>, but I want to specify this in XML! And call me an extremist, but I can't stand Java, since it nearly screwed my last year's TPE (I have coded long-to-run programs, for example a PHP stuff that read the 50 Megs of a transcription of the X chromosom, but I have never coded such a long-to-start program: I had to launch it 10 minutes before the beginning of my oral exam!... anyway.), therefore I won't use Ant. Furthermore, Ant is somewhat too generalist.

But here comes the XML Pipeline Definition Language. I simply love it! But... yeah, you guessed it, Sun has implemented it... in Java, of course (well, that sounds logical when you know that Norman works at Sun Microsystems... why, but whyyyyy???). But save the last dance for me: implementing it in C, using libxml2, is simple as ABC... if only I knew C.

Well, in principle, that does not sound that difficult: the processdefs give you all the command-lines you have to call in order to execute what the user wants (although predefined ones, such as implementation.xslt-transform, or implementation.xinclude, implementation.schema-validate, etc, would be very useful... and maybe refering to them as URIs, too). You look at the dependencies (quite easy to my mind), and there you go, you launch the stuff... and it works.

libxml has all what we need, from XML Signatures verification to XSLT transformations, and also XIncludes, DTD Validation, etc. We may need some bits of external code (such as Tidy), but using the command-line form of the processdefs helps us with it.

And open APIs are sooooooooooo fine!

J'ai fait mon premier programme C qui serve vraiment à quelque chose (et non pas un simple "HelloWorld!"). Alors voilà, c'est basé sur libxml2 par Daniel Veillard, et ça processe les XIncludes (ou en français). Bon, c'est sûr, dans la catégorie truc-de-la-mort-qui-tue-les-canards-à-trois-pattes, on a vu mieux, mais bon ! Je suis 'achtement fier quand même :D ... même si, bon, en fait, c'est surtout une application de l'API libxml2... et que j'ai récupéré une partie du code dans les tutos du site de libxml2 (très bien fait, d'ailleurs). Et ça se compile (sous Debian, avec toutes les dépendances qui vont bien installées, principalement libxml2-dev), avec gcc -I/usr/include/libxml2 -lxml2 -o xincludeproc xinclude.c.

Lire la suite