summaryrefslogtreecommitdiff
path: root/Docs/Support
diff options
context:
space:
mode:
authorunknown <zak@linux.local>2002-02-15 16:14:38 -0700
committerunknown <zak@linux.local>2002-02-15 16:14:38 -0700
commit1ab1e75806e72125fbda0bcede39e609e2306d25 (patch)
tree3e9cbadcc5da0bed3fd4825ab5d59a341c53d3bc /Docs/Support
parent00f6850dfe6f1e4af17a4dae48e798b7593309c9 (diff)
downloadmariadb-git-1ab1e75806e72125fbda0bcede39e609e2306d25.tar.gz
Patched conversion system to generate well-formed XML
Docs/Support/docbook-fixup.pl: Series of minor changes to convert the output of makeinfo to well-formed XML - Discarded DTD - ORA can add their own appropriate DTD - Added required XML PI - included appropriate character encoding information - Added missing abstract and bookinfo tags - Escaped ampersands in HTML escape sequences to allow validation - need to review Docs/Support/make-docbook: Forced validation of XML document at end of conversion process Removed temporary files - set makeinfo output to stdout BitKeeper/etc/ignore: Added Docs/safe-mysql.xml to the ignore list BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'Docs/Support')
-rwxr-xr-xDocs/Support/docbook-fixup.pl34
-rwxr-xr-xDocs/Support/make-docbook9
2 files changed, 38 insertions, 5 deletions
diff --git a/Docs/Support/docbook-fixup.pl b/Docs/Support/docbook-fixup.pl
index 1dde06a3074..03a2a29f1e8 100755
--- a/Docs/Support/docbook-fixup.pl
+++ b/Docs/Support/docbook-fixup.pl
@@ -1,4 +1,6 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
+# 2002-02-15 zak@mysql.com
+# Use -w to make perl print useful warnings about the script being run
sub fix_underscore {
$str = shift;
@@ -13,9 +15,39 @@ sub strip_emph {
return $str;
};
+print STDERR "\n--Post-processing makeinfo output--\n";
+# 2002-02-15 zak@mysql.com
+print STDERR "Discard DTD - ORA can add the appropriate DTD for their flavour of DocBook\n";
+<STDIN>;
+
+print STDERR "Slurp! In comes the rest of the file. :)\n";
$data = join "", <STDIN>;
+# 2002-02-15 zak@mysql.com
+print STDERR "Add an XML processing instruction with the right character encoding\n";
+$data = "<?xml version='1.0' encoding='ISO-8859-1'?>" . $data;
+
+# 2002-02-15 zak@mysql.com
+# Less than optimal - should be fixed in makeinfo
+print STDERR "Put in missing <bookinfo> and <abstract>\n";
+$data =~ s/<book lang="en">/<book lang="en"><bookinfo><abstract>/gs;
+
+# 2002-02-15 zak@mysql.com
+print STDERR "Convert existing ampersands to escape sequences \n";
+$data =~ s/&(?!\w+;)/&amp;/gs;
+
+# 2002-02-15 zak@mysql.com
+# Need to talk to Arjen about what the <n> bits are for
+print STDERR "Rework references of the notation '<n>'\n";
+$data =~ s/<(\d)>/[$1]/gs;
+
+# 2002-02-15 zak@mysql.com
+# We might need to encode the high-bit characters to ensure proper representation
+# print STDERR "Converting high-bit characters to entities\n";
+# $data =~ s/([\200-\400])/&get_entity($1)>/gs;
+# There is no get_entity function yet - no point writing it til we need it :)
+
print STDERR "Changing @@ to @...\n";
$data =~ s/@@/@/gs;
diff --git a/Docs/Support/make-docbook b/Docs/Support/make-docbook
index 2904eef4926..ec811030af1 100755
--- a/Docs/Support/make-docbook
+++ b/Docs/Support/make-docbook
@@ -13,7 +13,8 @@
sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> include.texi
# produce DocBook XML
- makeinfo --force --no-ifinfo --docbook manual.texi
- mv mysql.xml mysql-tmp.xml
- Support/docbook-fixup.pl <mysql-tmp.xml >mysql.xml
- rm -f mysql-tmp.xml
+ makeinfo --force --no-ifinfo --docbook -o - manual.texi |\
+ Support/docbook-fixup.pl > mysql.xml
+
+ # See if the XML output is well-formed
+ xmlwf mysql.xml