Reputation: 803
I am trying to convert a nested, bulleted list in HTML to XML-FO for output as a PDF in Apache FOP. The HTML looks like this
<ul>
<li>Item Number1</li>
<ul>
<li>Sub-Item 1</li>
<li>Sub-Item 2</li>
</ul>
</ul>
All of the XSLT I have tried creates a with an embedded for the subitems. FOP, however, complains that you can't have a list-block as a child of a list-block. Is this an issue with FOP? Or, is that simply not valid XML-FO and all of the XSLT examples are processing this construct incorrectly?
If it's the later, what is the proper XML-FO to produce a nested set of bullets like you would see in HTML?
Any help would be greatly appreciated!
Thanks!
Upvotes: 0
Views: 687
Reputation: 4403
FOP is right to complain, the specification states a list-block cannot have a list-block as a child.
You need to create a ghost list item for the nested list, don't put a label on the item (thus making it a ghost item), and put the nested list into the body of the ghost item.
There is a helpful diagram on page 139 of my XSL-FO book that is available for free download on a "try and buy" basis at http://www.CraneSoftwrights.com/training/#pfux ... if you decide not to pay for the book, please delete the copy that you download for free.
Upvotes: 2