Issue Details (XML | Word | Printable)

Key: DOXIA-324
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Lukas Theussl
Reporter: Arne Limburg
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven Doxia

Doxia generates wrong xdoc when generating book from docbook

Created: 23/May/09 02:21 PM   Updated: 08/Jun/09 05:06 AM   Resolved: 08/Jun/09 05:06 AM
Return to search
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.1.1

Time Tracking:
Not Specified

File Attachments: 1. Text File AbstractXdocBookSink.patch (2 kB)
2. Zip Archive doxia-book-sample.zip (2 kB)
3. Zip Archive doxia-book-sample.zip (2 kB)

Issue Links:
dependent
 

Testcase included: yes
Patch Submitted: Yes


 Description  « Hide

When generating a book from a docbook input the output is missing the starting document tag.



Arne Limburg added a comment - 23/May/09 02:23 PM

This test demonstrates the problem


Arne Limburg added a comment - 23/May/09 02:25 PM

I don't know if there is a more elegant way to do it, but the applied patch fixes the problem


Lukas Theussl added a comment - 24/May/09 01:07 AM

This is a general problem of the docbook parser, see DOXIA-184, it should be fixed there.


Lukas Theussl added a comment - 04/Jun/09 04:36 AM

Fixed in r781693

Note that your docbook sources are not valid. Doxia requires valid simplified docbook input, ie there should be an <article> root element. Your files should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.1//EN" "http://www.oasis-open.org/docbook/xml/simple/1.1/sdocbook.dtd">

<article>

<section id="section1">
  <title>Section 1</title>
  <para>This is the first section.</para>
</section>

</article>

Arne Limburg added a comment - 05/Jun/09 03:12 PM

Hi Lukas,

thank you for fixing this so fast. But there is still a bug in this piece of code (see the attached test).
I think the call to handleIdAnchor( parser, sink ) in handleStartTag in DocbookParser must go somewhere else in that method.

Thank you anyway, for me it now works since my articles need no id-attribute.


Lukas Theussl added a comment - 08/Jun/09 03:02 AM

Thanks for testing and the feedback!

So a fix would be to check for the special case of article and emit the anchor after the document start.

However, I have some doubts:

  • I checked that an id attribute is legal for article in simplified docbook, but I don't quite see the use case, what is it for?
  • we have removed automatic anchor generation from the apt and xdoc parsers (see eg DOXIA-152), I think the docbook should do the same. If the id attribute of an element is preserved, then one can link to that, you don't need an anchor. However, I don't use docbook myself so I'm not too sure if this isn't going to break something I am not aware of. Especially in a point release we should try not to change any expected behavior, but in principle I would vote for removing the anchor insertion.

Lukas Theussl added a comment - 08/Jun/09 05:06 AM

I have simply removed the anchor generation from the article tag for now, this fixes the build failure. The id is forwarded directly into the sink's head, eg for xdoc it goes into the <document> tag. I have opened DOXIA-334 for the general anchor generation issue.