GNOME Bugzilla – Bug 343372
xml warnings at runtime
Last modified: 2010-04-29 22:38:23 UTC
Using yelp-2.14.2 (compiled for firefox) and gnome-doc-utils-0.6.0, I get some xml (or xslt?) parsing errors at runtime. Using the help facility of various GNOME apps (the Help...Contents menu) I get a message on my console: /sw/share/yelp/info.xml:0: error : unterminated entity reference development tools (/sw is the prefix where I've installed everything related to GNOME) and in the case of gedit-2.12.1 I also get: Unmatched element: citerefentry Unmatched element: refentrytitle Unmatched element: citerefentry Unmatched element: refentrytitle I checked /sw/share/gnome/help/gedit/C/gedit.xml: it does contain two usages of citerefentry and refentrytitle, the tags are all balanced, and if I remove one, one of the warnings goes away. Not sure where to begin diagnosing these, whether it's yelp failing to support something, or yelp or gedit using some entities that aren't in gnome-doc-utils, or something deficient in my docbook support packages. Let me know what to try, or if you need more versioning info about my system.
Okay. Two seperate bugs. The second (easier one to diagnose) is because gnome-doc-utils doesn't support the citerefentry and refentrytitle. The first one has been hanging around for ages. I'm currently unable to reproduce. The problem lies in the info page stuff for the table-of-contents. For some reason, the code isn't closing the appropriate tag (presumably for the final section of the "dir" file). I played around with this a while ago, but nothing I did could reproduce the bug. If possible, could you supply your dir file (if you've > 1 info directory, please supply all the dir files) and I'll have another attempt at looking at this and fixing it. Thanks
The citerefentry issues is filed as #343414.
I discovered a way to recreate the other issue (that you Google!). It seems to be caused by the inclusion of "&" characters in the info dir file. I've committed a fix that removes them and replaces them with "&"'s which XML doesn't choke on. Closing. If you still experience the problem, please reopen. 2006-05-30 Don Scorgie <dscorgie@cvs.gnome.org> * src/yelp-toc-pager.c: Escape & characters when encountered in info processing (fixes #343372)
Don, this fix didn't catch everything. See my commit here: http://cvs.gnome.org/viewcvs/yelp/src/yelp-toc-pager.c?r1=1.86&r2=1.87 Your fix of splitting the string on ampersands and rejoining isn't optimal. We should just use xmlNewTextChild instead of xmlNewChild on lines 1613, 1615, and 1618 of yelp-toc-pager.c. It's safer and avoids excess string dups. Also, pre-escaping will cause ampersands to be double-escaped in xmlNewNsProp on line 1611. (Why don't we just use xmlNewProp?)
I also saw the ampersand-choking bug on 2.14. I updated to latest 2.15 cvs and now the choking is gone but ampersands appear as & I produced a patch based on Shaun's advice, and I can confirm that it fixes it for me. Can this be applied? (I have commit access, if that helps at all..)
Created attachment 68167 [details] [review] patch
The gnome-2-14 branch is currently working fine in this respect, the above patch is for HEAD.
Thanks for the patch, but I think you posted the wrong one.
Created attachment 68178 [details] [review] patch Yep, I meant this one
* src/yelp-toc-pager.c: (process_info_pending): Fix to properly escape ampersand characters by using xmlNewTextChild, patch from Daniel Drake. Fixes #343372