Red Hat Bugzilla – Bug 988192
Bug: Conditions are not working
Last modified: 2013-09-16 01:40:38 EDT
A topic is shared between two books for two separate products. Conditions ("JDG" for JBoss Data Grid and "WFK" for Web Framework Kit) are added to the topic to ensure a different paragraph appears for each book.
In the docbuilder, the WFK book displays the topic correctly (See the material under the "Reader Strategies" section title):
The JDG book shows no content for the same topic:
It looks like the conditions are correctly implemented in the topic and the CSP Maps.
Fixed in 0.33.6
The problem was caused by the way the builder copies the Topic DOM document into the section/chapter Document and actually had nothing to do with the conditions. You could replicate this by using a complex topic as the Front Matter topic and then you should see some of the content at the bottom of the topic will not exist.
When you are append/import nodes from another document the nodes are actually removed from the original Document/NodeList and then placed in the new one. Because of this you can't copy content by just doing a for loop and using NodeList.get(int) to copy the nodes. Instead you need to either work in reverse or loop making sure to get the initial element until the NodeList is empty.
0.33.6 has now been released.
The conditions display as expected on the docbuilder.
Note: There was a regression in 1.0.0 and 1.0.1 that caused this to happen again. It has been fixed in 1.0.2 which has just been released.