RelaxNG schema for introspection files

Ross Burton ross at burtonini.com
Fri May 29 07:31:48 PDT 2009


Hi,

I recently hacked up a RelaxNG schema for the introspection format
(attached), useful because emacs+nxml-mode can validate in realtime from
a relaxng schema.

It works for me with all *pure* introspection files, but because the
schema is strict it doesn't like extra namespaces in the document. This
means whilst it works for a "normal" introspection document it will say
that a document with inline documentation or Telepathy elements will
fail to validate.  Anyone who knows relaxNG better than I do is welcome
to tell me how to fix this. :)

Ross
-- 
Ross Burton                                 mail: ross at burtonini.com
                                          jabber: ross at burtonini.com
                                           www: http://burtonini.com
-------------- next part --------------
# Relax NG Compact schema for the DBus introspection format
# Copyright (C) 2009 Intel Corp
# MIT/X11 license

start = node

node =
   element node {
      attribute name { text }? &
      interface* &
      node*
   }

interface = 
   element interface {
      attribute name { text } &
      annotation* &
      method* &
      signal* &
      property*
   }

annotation =
   element annotation {
      attribute name { text } &
      attribute value { text }
   }

base-arg =
   attribute name { text }? &
   attribute type { text } &
   annotation?

arg-in-out = 
   element arg {
      base-arg &
      attribute direction { "in"|"out" }?
   }

arg-out = 
   element arg {
      base-arg &
      attribute direction { "out" }?
   }

method =
   element method {
      attribute name { text } &
      annotation* &
      arg-in-out*
   }

signal =
   element signal {
      attribute name { text } &
      annotation* &
      arg-out*
   }

property =
   element property {
      attribute name { text } &
      attribute type { text } &
      attribute access { "read"|"write"|"readwrite" }
   }


More information about the dbus mailing list