aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-11-15 16:55:43 -0600
committerTed Gould <ted@gould.cx>2010-11-15 16:55:43 -0600
commit080cf37f48dba3dc521167bd3ddc51f45681ea1d (patch)
treee24290fbbd2837491e8576bf830efbc0de7c0095 /libdbusmenu-glib
parentbf33041c44cc9edd029a2ebe1359a78103f8e9f9 (diff)
downloadlibdbusmenu-080cf37f48dba3dc521167bd3ddc51f45681ea1d.tar.gz
libdbusmenu-080cf37f48dba3dc521167bd3ddc51f45681ea1d.tar.bz2
libdbusmenu-080cf37f48dba3dc521167bd3ddc51f45681ea1d.zip
Cleaning out namespaces from the XML so that GDBus will read it.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/Makefile.am13
-rw-r--r--libdbusmenu-glib/clean-namespaces.xslt9
-rw-r--r--libdbusmenu-glib/client.c4
-rw-r--r--libdbusmenu-glib/server.c4
4 files changed, 22 insertions, 8 deletions
diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am
index be70cfa..4e97428 100644
--- a/libdbusmenu-glib/Makefile.am
+++ b/libdbusmenu-glib/Makefile.am
@@ -2,6 +2,7 @@
CLEANFILES =
EXTRA_DIST = \
+ clean-namespaces.xslt \
dbusmenu-glib.pc.in \
dbus-menu.xml \
client-marshal.list \
@@ -20,8 +21,8 @@ libdbusmenu_glibinclude_HEADERS = \
client.h
libdbusmenu_glib_la_SOURCES = \
- dbus-menu.xml.h \
- dbus-menu.xml.c \
+ dbus-menu-clean.xml.h \
+ dbus-menu-clean.xml.c \
menuitem.h \
menuitem.c \
menuitem-marshal.h \
@@ -62,10 +63,14 @@ pkgconfigdir = $(libdir)/pkgconfig
sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
echo ";" >> $@
+dbus-menu-clean.xml: dbus-menu.xml
+ xsltproc $(srcdir)/clean-namespaces.xslt $< > $@
+
+CLEANFILES += dbus-menu-clean.xml
BUILT_SOURCES = \
- dbus-menu.xml.c \
- dbus-menu.xml.h \
+ dbus-menu-clean.xml.c \
+ dbus-menu-clean.xml.h \
client-marshal.h \
client-marshal.c \
menuitem-marshal.h \
diff --git a/libdbusmenu-glib/clean-namespaces.xslt b/libdbusmenu-glib/clean-namespaces.xslt
new file mode 100644
index 0000000..125a10f
--- /dev/null
+++ b/libdbusmenu-glib/clean-namespaces.xslt
@@ -0,0 +1,9 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dox="http://www.ayatana.org/dbus/dox.dtd">
+ <xsl:template match="*|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*" />
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="@dox:*|dox:*"/>
+</xsl:stylesheet>
+
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index ff7d5ec..7c90fa6 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -41,7 +41,7 @@ License version 3 and version 2.1 along with this program. If not, see
#include "client-menuitem.h"
#include "server-marshal.h"
#include "client-marshal.h"
-#include "dbus-menu.xml.h"
+#include "dbus-menu-clean.xml.h"
/* Properties */
enum {
@@ -262,7 +262,7 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass)
if (dbusmenu_node_info == NULL) {
GError * error = NULL;
- dbusmenu_node_info = g_dbus_node_info_new_for_xml(dbus_menu_xml, &error);
+ dbusmenu_node_info = g_dbus_node_info_new_for_xml(dbus_menu_clean_xml, &error);
if (error != NULL) {
g_error("Unable to parse DBusmenu Interface description: %s", error->message);
g_error_free(error);
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 652b2a8..63d237f 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -36,7 +36,7 @@ License version 3 and version 2.1 along with this program. If not, see
#include "server.h"
#include "server-marshal.h"
-#include "dbus-menu.xml.h"
+#include "dbus-menu-clean.xml.h"
static void layout_update_signal (DbusmenuServer * server);
@@ -288,7 +288,7 @@ dbusmenu_server_class_init (DbusmenuServerClass *class)
if (dbusmenu_node_info == NULL) {
GError * error = NULL;
- dbusmenu_node_info = g_dbus_node_info_new_for_xml(dbus_menu_xml, &error);
+ dbusmenu_node_info = g_dbus_node_info_new_for_xml(dbus_menu_clean_xml, &error);
if (error != NULL) {
g_error("Unable to parse DBusmenu Interface description: %s", error->message);
g_error_free(error);