summaryrefslogtreecommitdiff
path: root/src/yelp-toc-pager.c
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2004-01-16 03:57:53 +0000
committerShaun McCance <shaunm@src.gnome.org>2004-01-16 03:57:53 +0000
commita79910105895c00c2f5c17d8ab32f5fa27c65e1f (patch)
tree181005ba7798240a25a75e2ceacaa30abad18d60 /src/yelp-toc-pager.c
parent4742244971ca9f07d3419f3460cd3acc6ba071ad (diff)
downloadyelp-a79910105895c00c2f5c17d8ab32f5fa27c65e1f.tar.gz
- Relative path handling broke absolute-sans-scheme path handling. Now
* src/yelp-base.c: - Relative path handling broke absolute-sans-scheme path handling. Now fixed. * src/yelp-db-pager.c: - Handle XInclude. * src/yelp-toc-pager.c: - The parser context seems to fail on all files after a single bad XML file, which I think is a bug in libxml2. This caused a single bad OMF file to bomb the whole TOC. I've worked around the problem for now by creating a new parser context after errors.
Diffstat (limited to 'src/yelp-toc-pager.c')
-rw-r--r--src/yelp-toc-pager.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c
index 549d285c..08613e8f 100644
--- a/src/yelp-toc-pager.c
+++ b/src/yelp-toc-pager.c
@@ -477,12 +477,23 @@ process_omf_pending (YelpTocPager *pager)
omf_doc = xmlCtxtReadFile (priv->parser,
(const char *) file,
NULL,
- XML_PARSE_XINCLUDE |
+ XML_PARSE_NOBLANKS |
XML_PARSE_NOCDATA |
XML_PARSE_NOENT |
+ XML_PARSE_NOERROR |
XML_PARSE_NONET );
- if (!omf_doc)
+ if (!omf_doc) {
+ g_warning (_("Could not load the OMF file '%s'."), file);
+ /* FIXME:
+ * There appears to be a bug in libxml2 that prevents files from being
+ * parsed with a parser context after that context has failed on any
+ * single file. So we'll just free the parser context and make a new
+ * one if there is an error.
+ */
+ xmlFreeParserCtxt (priv->parser);
+ priv->parser = xmlNewParserCtxt ();
goto done;
+ }
omf_cur = xmlDocGetRootElement (omf_doc);
if (!omf_cur)
@@ -641,10 +652,10 @@ process_read_menu (YelpTocPager *pager)
priv->toc_doc = xmlCtxtReadFile (priv->parser,
DATADIR "/yelp/toc.xml",
NULL,
- XML_PARSE_XINCLUDE |
XML_PARSE_NOBLANKS |
XML_PARSE_NOCDATA |
XML_PARSE_NOENT |
+ XML_PARSE_NOERROR |
XML_PARSE_NONET );
if (!priv->toc_doc) {