[gobject-introspection/gir-docbook] g-ir-doc-tool: Add DOCTYPE
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/gir-docbook] g-ir-doc-tool: Add DOCTYPE
- Date: Fri, 12 Aug 2011 08:55:01 +0000 (UTC)
commit 146f05bac5ac92f3f83558dc58f3ec256d998be0
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date: Thu Aug 11 18:43:11 2011 +0200
g-ir-doc-tool: Add DOCTYPE
giscanner/docbookwriter.py | 8 ++++++--
tests/doctool/Regress-1.0-expected.xml | 5 +++++
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/docbookwriter.py b/giscanner/docbookwriter.py
index 0de8b58..93c26d7 100644
--- a/giscanner/docbookwriter.py
+++ b/giscanner/docbookwriter.py
@@ -28,6 +28,11 @@ from .xmlwriter import XMLWriter
XMLNS = "http://docbook.org/ns/docbook"
XMLVERSION = "5.0"
+DOCTYPE = """<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+<!ENTITY version SYSTEM "version.xml">
+]>"""
def _space(num):
return " " * num
@@ -267,6 +272,7 @@ class DocBookWriter(object):
page.add_signal(DocBookEntity(signal.name, "signal", signal))
def write(self, output):
+ self._writer.write_line(DOCTYPE)
with self._writer.tagcontext("book", [
("xml:id", "page_%s" % self._namespace.name),
("xmlns", XMLNS),
@@ -421,5 +427,3 @@ class DocBookWriter(object):
parent_chain.reverse()
return parent_chain
-
-
diff --git a/tests/doctool/Regress-1.0-expected.xml b/tests/doctool/Regress-1.0-expected.xml
index 5ecaa14..660096f 100644
--- a/tests/doctool/Regress-1.0-expected.xml
+++ b/tests/doctool/Regress-1.0-expected.xml
@@ -1,4 +1,9 @@
<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+<!ENTITY version SYSTEM "version.xml">
+]>
<book xml:id="page_Regress"
xmlns="http://docbook.org/ns/docbook"
version="5.0">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]