After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343372 - xml warnings at runtime
xml warnings at runtime
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: XSLT
2.14.x
Other All
: Normal normal
: ---
Assigned To: Yelp maintainers
Yelp maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-30 08:55 UTC by Daniel Macks
Modified: 2010-04-29 22:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.32 KB, patch)
2006-06-29 14:44 UTC, Daniel Drake
none Details | Review
patch (1.31 KB, patch)
2006-06-29 17:20 UTC, Daniel Drake
committed Details | Review

Description Daniel Macks 2006-05-30 08:55:45 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.
Comment 1 Don Scorgie 2006-05-30 10:34:11 UTC
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
Comment 2 Shaun McCance 2006-05-30 17:04:49 UTC
The citerefentry issues is filed as #343414.
Comment 3 Don Scorgie 2006-05-30 17:55:19 UTC
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)
Comment 4 Shaun McCance 2006-06-20 17:29:17 UTC
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?)

Comment 5 Daniel Drake 2006-06-29 14:43:40 UTC
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 &amp;

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..)
Comment 6 Daniel Drake 2006-06-29 14:44:35 UTC
Created attachment 68167 [details] [review]
patch
Comment 7 Daniel Drake 2006-06-29 14:59:02 UTC
The gnome-2-14 branch is currently working fine in this respect, the above patch is for HEAD.
Comment 8 Brent Smith (smitten) 2006-06-29 16:27:35 UTC
Thanks for the patch, but I think you posted the wrong one.
Comment 9 Daniel Drake 2006-06-29 17:20:51 UTC
Created attachment 68178 [details] [review]
patch

Yep, I meant this one
Comment 10 Brent Smith (smitten) 2006-07-01 14:24:42 UTC
        * src/yelp-toc-pager.c: (process_info_pending): Fix to properly escape
        ampersand characters by using xmlNewTextChild, patch from Daniel
        Drake.  Fixes #343372