[Xcb] GSoC 2009: XKB and XI2 support

Josh Triplett josh at joshtriplett.org
Fri Sep 18 17:45:13 PDT 2009

On Wed, Sep 16, 2009 at 10:45:47PM -0700, Barton C Massey wrote:
> In message <20090917013638.GC3274 at feather> you wrote:
> > On Wed, Sep 16, 2009 at 10:47:59AM -0700, Barton C Massey wrote:
> > > We should add an "xml-version" attribute to the <xcb> tag,
> > > in fact we should have done this long ago.  Then things that
> > > don't yet understand new syntax can simply ignore files with
> > > too-new version.  This means that wireshark wouldn't
> > > immediately be able to decode XKB, but it can't do that now
> > > AFAIK.
> > 
> > So, after thinking about this further, I realized that versioning seems
> > somewhat superfluous.  XML-XCB doesn't work like HTML or other markup
> > languages; if you see something you don't understand in a protocol spec,
> > give up and don't even try.

> I don't think I believe this.  Generating partial code from a spec
> would be bad for semi-obvious reasons.


> Failing to generate code with no explanation would be annoying.

Also agreed.

> I'd rather get a warning that "foo.xml requires xcb-xml 5.7 which is
> not supported by this translator" than "syntax error at line 12" or
> worse yet silent failure to generate code.

As above, silent failure seems entirely unacceptable.  I'd like to think
we can do slightly better than "syntax error at line 12" these days.  If
nothing else, translators can use a validating XML parser and an XML
schema to get the same effect as versioning but with the added benefit
of actually checking that the XML matches the version of the schema they
understand; they can then parse the code with much simpler error
handling: die("The XML schema said this couldn't happen");

- Josh Triplett

More information about the Xcb mailing list