Older blog entries for vdv (starting at number 5)

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!