diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-01-13 22:14:24 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-01-13 22:15:12 -0500 |
commit | 7550685c356eb3701abac23accaadec32cb905c9 (patch) | |
tree | fd50c0aa9f4ca29070365afacc52c1ae2f388ff8 /libyelp/yelp-docbook-document.c | |
parent | 05bf4a2f6885475ae592c9128390cc155289d69c (diff) | |
download | yelp-7550685c356eb3701abac23accaadec32cb905c9.tar.gz |
yelp-docbook-document: Provide named entities without docbook-dtds
Diffstat (limited to 'libyelp/yelp-docbook-document.c')
-rw-r--r-- | libyelp/yelp-docbook-document.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c index a00e567a..d4b4cec9 100644 --- a/libyelp/yelp-docbook-document.c +++ b/libyelp/yelp-docbook-document.c @@ -38,6 +38,8 @@ #include "yelp-debug.h" #define STYLESHEET DATADIR"/yelp/xslt/db2html.xsl" +#define DEFAULT_CATALOG "file:///etc/xml/catalog" +#define YELP_CATALOG "file://"DATADIR"/yelp/dtd/catalog" typedef enum { DOCBOOK_STATE_BLANK, /* Brand new, run transform as needed */ @@ -125,6 +127,19 @@ yelp_docbook_document_class_init (YelpDocbookDocumentClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); YelpDocumentClass *document_class = YELP_DOCUMENT_CLASS (klass); + const gchar *catalog = g_getenv ("XML_CATALOG_FILES"); + + /* We ship a faux DocBook catalog. It just contains the common entity + * definitions. Documents can use the named entities they expect to + * be able to use, but we don't have to depend on docbook-dtds. + */ + if (catalog == NULL) + catalog = DEFAULT_CATALOG; + if (!strstr(catalog, YELP_CATALOG)) { + gchar *newcat = g_strconcat (YELP_CATALOG, " ", catalog, NULL); + g_setenv ("XML_CATALOG_FILES", newcat, TRUE); + g_free (newcat); + } object_class->dispose = yelp_docbook_document_dispose; object_class->finalize = yelp_docbook_document_finalize; |