Older blog entries for vdv (starting at number 9)

Relax NG
    Finished yesterday a first decent-but-not-complete-yet version of my Relax NG validator and a very raw on line validator. There are still a number of limitations (includes and external refs, class names and datatypes others than Relax NG builtin "string" and "token" and some validity checks of the schemas themselves are not implemented yet) but the validator passes the 213 tests of the test suite corresponding to what is already implemented.
DSDL
    My next step will be to implement a prototype of the strawman I have proposed for the DSDL Interoperability Framework which enables to perform transformations during the validation of a document. BTW, I have noticed that Relax NG does already implement such a transformation in its "list" pattern which splits a text node into a list and I see it as a good sign that my proposal doesn't break the mathematical foundation of Relax NG...
Relax NG
    I have been busy with my Python implementation of Relax NG and it's nice to have found enough time to do some coding again. I have implemented most of the core features (ie except datatypes, external references and name classes) and it passes the 169 corresponding tests of the test suite except 13 which deal with the detection of nasty errors in the schemas. From there, I am wondering if my next step should be to continue the implementation or to start implementing some of the features of the Interoperability Framework which I am proposing to the ISO DSDL workgroup.
Relax NG

    Just started to hack a prototype of a Relax NG validator in Python. I am aware that this is duplication of work and that another Python implementation is on the way but I have thought that working on my own implementation would help me for the book I am starting to write on the subject and for the work I am doing on the interoperability framework of DSLD. I see my implementation as "self-didactical" and am not sure if it will eventually turn into something which can be used by others, but I have already learned quite a lot from it.

    I am following James Clark's derivative algorithm also described by A.M. Kuchling who is working on the other Python implementation and am also amazed by the elegance of the thing. The variation which I am bringing over this is borrowed from my Examplotron: having learned that instance documents can be seen as schemas, I am considering the instance document being validated as a set of Relax NG patterns following a different serialization.

    Using the same classes for the Relax NG patterns describing the schema and the nodes from the instance document makes these classes more generic and the validation become the computation of the derivations of patterns relative to other patterns which is kind of fun.

XML Europe 2002

    XML Europe is over and it has been one of the best conferences I have ever seen, with lot of food for thoughts and subject of stories for xmlhack and XMLfr...

DSDL

    The ISO DSDL group seems to be really on its track by now and I have been lucky enough to be in the wagon and have the opportunity (and honnor) to work with people such as James Clark, Murata Makoto, Rick Jelliffe or Ken Holman in a working group chaired by Charles Goldfarb.

Namespaces warehouse

    XML Europe has been tremendously active for me with the ISO meetings, a tutorial and a presentation about XML schema languages, an expert panel and an afternoon being track chair but my presentation which I consider as the most promissing is my project of Namespaces warehouse. To make it short, it's a proposal to create a search engine to find all you need to know about how XML namespaces are being used on the web.

    This is a high potential project for which I am looking for sponsors and partners.

Interview

    XML.com has published my interview about my W3C XML Schema book yesterday.

    It's not that usual for an author (at least in technical domains) to bash the subject of his book, but I couldn't honnestly be too positive about W3C XML Schema.

    My only fear is that people might take it personaly: the most amazing thing about this recommendation is that although I have great respect for each member of the W3C XML Schema Working Group (at least for those I know), I find the result of their work less than perfect... The better proof is that a book like mine which tries to guide users around the land mines is needed at all!

    I see it as an indication that the current organization of the W3C doesn't scale.

WikiMl

Published a first early release of a WikiMl web site including:

The idea is to define a "wiki markup language" which would be a non XML syntax for a subset of XHTML following the rules defined by the various WikiWikiWeb systems and to treat it as a full class markup language supported by parsers and writers allowing to use it directly with XML tools (as opposed to developping a full system).

It's not ready for full public announcement and there is not much on the site yet (it's more a raw structure to support some hacking which could be done during XML Europe), but I have already used the parser which is published here to write many documents including 2 of the presentations which I will be doing at XML Europe.

Stay tuned and feel free to join the lists and add stuff in the wiki web...

Do XML specifications deserve their Cathedral and their Bazaar ?

Matthew Gertner has posted on xml-dev a new call for an independent organization or facilatator which would help developers and small groups to publish proposals for specifications.

The idea is not new and it's something I had been calling for last year, but Gerner thinks that "it is now time for action"...

Future will tell, but I hope he could be right!

Just published a copy of the XML Schema languages tutorial which I will be giving at XML Europe.

Since this tutorial is introducing XML schema languages based on the classification proposed by the DSDL ISO working group starting with rule based schema languages (XSLT and Schematron are covered in the tutorial), following with grammar based schema languages (RELAX NG) and concluding with Object Oriented schema languages (W3C XML Schema), the DSDL web site seemed like the best place to publish such a piece!

The good news is that after this work, I am still more convinced that this classification does make sense and that learning and eventually developping and implementing schema languages in this order leads to a layered approach which clarifies the landscape!

6 May 2002 (updated 6 May 2002 at 11:57 UTC) »

Just hacked a simple FSM (Finite State Machine) in Python this morning. It's not in a stage I can publish it yet, but I can already give an example of usage...

The purpose for me is to have a replacement to "mon" to monitor my machines. "Mon" is very powerful and flexible, but for whatever reason, I have never been able to master it enough to get really what I'd need and I wanted something simpler and more in line with my past experience of real time telecommunication systems developper.

A simple test system monitoring a network device with my brand new "pymachine" would first define the transition table of the machine:

#!/usr/bin/python

import time, sched, pymachine, commands class WatchDevice: def __init__(self, device="eth0"): self.device=device self.machine=pymachine.PyMachine() # Definition of the FSM self.machine.addState("off") self.machine.addEvent("off", "isOn", self.isOn); self.machine.addState("on") self.machine.addEvent("on", "isOff", self.isOff); self.machine.addEvent("on", "pingFails", self.pingFails); self.machine.addState("isolated") self.machine.addEvent("isolated", "isOff", self.isOff); self.machine.addEvent("isolated", "pingOK", self.pingOK);

This one has 3 states (off, on and isolated) and 4 events (isOn, isOff, pingFails and pingOK). It would also need to define a couple of handlers:

		# Definition of the handlers	
         
self.handler1=pymachine.Handler(self.handlerTestDevice, 
			(), 5, 1)
		self.machine.startHandler(self.handler1)
		self.handler2=pymachine.Handler(self.handlerTestPing, 
			(), 5, 60)

Here we've defined 2 handlers, the first one is occurring every second and started right now, the second one is occurring every minute and will be started later on. The methods implementing the transitions and the handlers can then be coded:

	# Transitions
	
	def isOn(self, args):
		print "%s is on" % self.device
		self.machine.setState("on")
		self.machine.restartHandler(self.handler2)

def isOff(self, args): print "%s is off" % self.device self.machine.setState("off") self.machine.stopHandler(self.handler2)

def pingFails(self, args): print "%s is isolated" % self.device self.machine.setState("isolated")

def pingOK(self, args): print "%s is ok" % self.device self.machine.setState("on")

# Handlers

def handlerTestDevice(self, machine, handler, args): run=commands.getstatusoutput("/sbin/ifconfig | grep %s" % self.device) #print run if run[0] == 0: machine.sendEvent("isOn") else: machine.sendEvent("isOff")

def handlerTestPing(self, machine, handler, args): run=commands.getstatusoutput("/bin/ping -I %s -w10 -c5 192.127.127.11" % self.device) #print run if run[0] == 0: machine.sendEvent("pingOK") else: machine.sendEvent("pingFails")

And the machine can be started:

	def run(self):
		self.machine.run()


watch=WatchDevice() watch.run()

What's the interest of this type of programing? FSM are often safer, simpler to implement and simpler to test than traditional programing as soon as the number of inter-dependent tests is growing. Here, the transitions are clearly related to a couple (state, event) and can be tested as such.

I'll try to post the full library when it'll be more complete. In the meantime (or if I forget), drop me an email if you are interested.

I have almost finished to write the tutorial about XML schema languages I will deliver at XML Europe 2002.

The agenda being schema languages (note the "s") I have tried to figure out a logical progression from the simplest to the most complex schema language and have been very surprised to see the nice transition between schemas written in XSLT (yes, XSLT can be used as a XML schema language), Schematron, RELAX NG and W3C XML Schema.

The amazing thing is that the latest seems much easier to explain after you've got the background of the first three. I hope my students will be sensible to this progression!

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!