[PATCH] fix introspect.dtd

Kees Jongenburger kees.jongenburger at gmail.com
Sat Oct 31 03:54:44 PDT 2009


The following patch modifies the introspect.dtd to allow dbus
introspection files to define signals with zero one or more arguments
and zero one or more annotations. While it is possible to create
signals with multiple argument the dtd doesn't allow this.

Greetings

Rationale:
For example when validating the following IMHO valid introspection
files I get the following errors. I believe the it was the original
author's intent to allow this.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection
1.0//EN" "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
<node name="/com/test/Platform">
  <interface name="com.test.ValidSignals">
                <signal name="node_with_no_child_nodes"/>

                <signal name="node_with_one_child_arg">
                        <arg type="i" name="firstchild"/>
                </signal>

                <signal name="node_with_two_child_args">
                        <arg type="i" name="firstchild"/>
                        <arg type="i" name="seconddhild"/>
                </signal>
  </interface>
</node>


#xmllint -valid valid_signals.xml
valid_signals.xml:10: element signal: validity error : Element signal
content does not follow the DTD, expecting (arg , annotation), got
                <signal name="node_with_no_child_nodes"/>
                                                         ^
valid_signals.xml:14: element signal: validity error : Element signal
content does not follow the DTD, expecting (arg , annotation), got
(arg )
                </signal>
                         ^
valid_signals.xml:19: element signal: validity error : Element signal
content does not follow the DTD, expecting (arg , annotation), got
(arg arg )
                </signal>
                         ^



*** introspect.dtd.orig 2009-10-12 16:22:21.000000000 +0200
--- introspect.dtd      2009-10-31 11:40:14.000000000 +0100
***************
*** 21,27 ****
       The DTD format can't express that subtlety. -->
  <!ATTLIST arg direction (in|out) "in">

! <!ELEMENT signal (arg,annotation)>
  <!ATTLIST signal name CDATA #REQUIRED>

  <!ELEMENT property (annotation)>  <!-- AKA "attribute" -->
--- 21,27 ----
       The DTD format can't express that subtlety. -->
  <!ATTLIST arg direction (in|out) "in">

! <!ELEMENT signal (arg*,annotation*)>
  <!ATTLIST signal name CDATA #REQUIRED>

  <!ELEMENT property (annotation)>  <!-- AKA "attribute" -->


More information about the dbus mailing list