Bug 994686

Summary: publican incorrectly drops entities in some attributes
Product: [Community] Publican Reporter: RaphaΓ«l Hertzog <raphael>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.1CC: aigao, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 4.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-19 02:46:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample document with entity in attribute none

Description RaphaΓ«l Hertzog 2013-08-07 19:02:39 UTC
Created attachment 784087 [details]
Sample document with entity in attribute

Take the attached test case. It contains an entity:
<!ENTITY url-bts "http://bugs.debian.org/">

This entity is put in a url attribute of a ulink tag:
<ulink url="&url-bts;566351">#566351</ulink> 

When you generate the HTML output, the entity is not correctly expanded. In fact it's dropped. If you look at the intermediary files you will see that the entity is still there in the tmp/xml_tmp/ tree, but it's gone from tmp/xml/.

This suggests that Publican is incorrectly dropping that entity from the XML.

This bug has been originally reported to Debian by Simon Paillard in http://bugs.debian.org/719000

Comment 2 Jeff Fearn 🐞 2013-09-23 04:52:33 UTC
I expect this is a bug in XML::TreeBuilder, will track it down.

Comment 3 HSS Product Manager 2013-09-23 05:07:32 UTC
HSS-QE has reviewed and declined this request. QE for this bug will be handled by IED.

Comment 4 Jeff Fearn 🐞 2013-09-24 07:10:41 UTC
Might be a limitation of XML::Parser::Expat http://www.perlmonks.org/?node_id=384128

Moar digging

Comment 5 Jeff Fearn 🐞 2013-09-26 01:59:43 UTC
This is a bug in XML::TreeBuilder, opened a bug upstream.

Comment 6 Jeff Fearn 🐞 2013-09-26 03:19:51 UTC
Updated dep versions to require fixed upstream package XML::TreeBuilder, which will be released along with next publican.

Comment 7 Ruediger Landmann 2013-10-11 02:26:39 UTC
Still doesn't seem to be working in publican-3.9.9-0.fc19.t4.noarch

I constructed the test case from comment #0 but when I built it:

<para>see <ulink url="&url-bts;566351">#566351</ulink> </para>

got transformed to:

<div class="para">
	see <a href="566351">#566351</a>
</div>

The entity did not get resolved

Comment 8 Jeff Fearn 🐞 2013-10-11 02:30:21 UTC
The publican users guide has this in the Introduction.xml file, does that work for you?

Make sure that if you are doing this you include the full DOCTYPE including the reference to the entity file.

Comment 9 Ruediger Landmann 2013-10-11 02:43:27 UTC
Works as expected with an entity used in the id of an element (like in the PUG), but doesn't work in the URL case reported in this bug.

Comment 10 Jeff Fearn 🐞 2013-10-11 06:15:14 UTC
More correctly, works in root node, but not in child nodes.

Comment 11 Jeff Fearn 🐞 2013-10-11 06:29:57 UTC
Opened upstream bug https://rt.cpan.org/Ticket/Display.html?id=89402, committed patch to upstream devel branch.

Comment 12 Jeff Fearn 🐞 2013-10-28 03:43:44 UTC
Bumped dep for XML::TreeBuilder to 5.1.

To ssh://git.fedorahosted.org/git/publican.git
   9f1135a..8d543ad  devel -> devel

Comment 13 Ruediger Landmann 2013-10-29 05:07:21 UTC
Attached test case verified with publican-3.9.9-0.fc19.t23.noarch