Bug 751638

Summary: Conditional text not working.
Product: [Community] Publican Reporter: eric
Component: publicanAssignee: Ruediger Landmann <rlandman+disabled>
Status: CLOSED INSUFFICIENT_DATA QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.3CC: jfearn, mmcallis, rlandman+disabled, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-23 10:38:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description eric 2011-11-06 19:33:06 UTC
Description of problem: 

From Jessica Tomechak:
Hello all, I have been using Publican to create html and PDF output for about 3 months. I can not get conditional tagging to work. When I add a condition: anything line to the publican.cfg, every XML element in my book that has any condition="whatever" attribute is EXcluded from the document.

For example, my publican.cfg might contain this:

condition: v1.1

And my XML files might contain these:

<section condition="v1.1"> ... </section>

<phrase condition="comments"> ... </phrase>

When I build the file, both the section and the phrase are omitted from the output. This occurs no matter what value I assign to condition in publican.cfg, whether it's a comma-delimited list, whether it includes dots or underscores, whether it's enclosed in double quotes, or whether the value is omitted entirely, like this:

condition:

...if the condition: line is present, all conditional-tagged content is omitted, regardless of the actual conditional tag value. This occurs when using Publican on Windows and on Ubuntu.

Any advice would be much appreciated.


Version-Release number of selected component (if applicable): 2.3

Comment 1 Ruediger Landmann 2011-11-08 00:00:21 UTC
[Moving this upstream]

Hi Jessica

I tested this on Publican 2.6 on Fedora, and can't reproduce the issue. Could you please test the basic mechanism for me, and see if the same thing happens on your installations?

1. Create a new book:

publican create --name Conditions

2. Change into the new directory that Publican created

3. Edit the en-US/Chapter.xml file to include these lines immediately after the para that contains "This is a test paragraph":

<para condition="alpha">
Only in the Alpha version.
</para>
<para condition="beta">
Only in the Beta version.
</para>
<para condition="beta,GA">
In the Beta and GA versions.
</para>

4. Build the book:

publican build --formats html-single --langs en-US

5. Look at the built HTML file: tmp/en-US/html-single/index.html -- you should see all three new paragraphs in the page. ("Only in the Alpha version. Only in the Beta version. In the Beta and GA versions.")

6. Edit the publican.cfg file to add the line:

condition: alpha

7. Rebuild the book:

publican build --formats html-single --langs en-US

8. Look at the built HTML file: tmp/en-US/html-single/index.html -- only the first of the three new paragraphs should now appear. You should not see "Only in the Beta version. In the Beta and GA versions.

9. Repeat steps 6-8 with "condition: beta" in the publican.cfg file, then "condition: GA". The text in the built HTML should change each time.



Let me know if any of this works for you; and if it doesn't, what version of Publican you tried.