Vitavonni

Fri, 09 Feb 2007

XML schema datatypes

... suck.

The XML Schema "datetime" format can't be handled by Java's SimpleFormat (ok, that probably is more Javas fault, of not being able to handle hours:minutes in the timezone specification, anyway, this is mildy annoying).

The XSLT2 parsers are very intolerant about the format of the time specification, too. They could have made more stuff optional such as the specification of seconds; an error here will make the whole XSLT fail with an exception. Some compact form of error handling would be nice... as would be a smart parser which can handle various formats.

The XML Schema "duration" is even worse. First of all, it was completely forgotton when doing XSLT 2; there are no functions to format or disassemble it (except by regular expressions, which could also use a zero-width lookahead).

Secondly, it's lacking common specifications such as "next week". While "next week" is computationally equivalent to "in 7 days", it can have different semantics in some contexts (especially when not being aligned):

If I'm looking for the week February 9th 2007 is in, the result is February 5th two February 11th. If I'm looking at a 7 day interval containing this day, there are infinite possibilities (aligned on milliseconds and below...). So it does make sense to make a difference between 7 days and a week.

[category: /en/xml | Permalink]

DBus user bus?

So far, DBus has two types of busses: the session and the system bus.

The session bus is used by most of your desktop applications.

The system bus is used e.g. by Hal signalling that new hardware was added, or by NetworkManager for network connectivity changes. The system bus is protected via a security policy.

Problems arise now when you need to locate your session DBus from a different session. For example, from a cron job.

There is a DBus application called "notification daemon" which can display popup baloons. This is useful for signaling yourself e.g. the completion of a long-running computation or just about anything you want. But it's using the session bus, so you can't reach it from outside of your current session.

A year ago, I wrote a hack for this, which will locate your current Gnome session, read the environment variable to find the session bus and then send a message to the sessions notification-daemon.

This is an ugly hack, however yesterday and today people asked on #dbus precisely how to do this. It seems to be a common question.

Maybe DBus should be extended by a "user" DBus, and applications such as music players or the notification daemon should actually listen on that bus (as well).

Maybe it could also be made possible to (securely) locate your session DBus via the system bus, I don't know how detailed the security policies of the system DBus are.

[category: /en/linux | Permalink]
Menu
[planet.debian]
[planet.xmlhack]
[planet SELinux]
[munichblogs]
[email]
[RSS 2 feed]
[English RSS 2]
Categories
< February 2007 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728   
Archives
2010-Mar
2010-Feb
2010-Jan
2009-Dec
2009-Nov
2009-Oct
2009-Sep
2009-Aug
2009-Jul
2009-Jun
2009-May
2009-Apr
2009-Mar
2009-Feb
2009-Jan
2008-Dec
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
Other links:
Swing and the City - Lindy Hop in Munich