Bug 56344 - WordToHtmlConverter cannot create table in table (fix inside description)
Summary: WordToHtmlConverter cannot create table in table (fix inside description)
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 09:12 UTC by Jk
Modified: 2014-04-10 10:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jk 2014-04-03 09:12:18 UTC
If you use WordToHtmlConverter to word with table in table you cannot see same thing inside html.

reason: 
in protected void processTable(HWPFDocumentCore hwpfDocument, Element flow,
            Table table ){
////skip some analyse
final Element tableElement = htmlDocumentFacade.createTable();
        tableElement.setAttribute(bla-bla);

        if ( tableHeader.hasChildNodes() )
        {
            tableElement.appendChild( tableHeader );
        }
        if ( tableBody.hasChildNodes() )
        {
            tableElement.appendChild( tableBody );
            flow.appendChild( tableElement );
        }
        else
        {
            logger.log(bla-bla);
        }
}


and at last you need to do:

flow.appendChild(tableElement);

otherwise you table will be without correct father
Comment 1 Jk 2014-04-10 10:52:05 UTC
(In reply to Jk from comment #0)
> If you use WordToHtmlConverter to word with table in table you cannot see
> same thing inside html.
> 
> reason: 
> in protected void processTable(HWPFDocumentCore hwpfDocument, Element flow,
>             Table table ){
> ////skip some analyse
> final Element tableElement = htmlDocumentFacade.createTable();
>         tableElement.setAttribute(bla-bla);
> 
>         if ( tableHeader.hasChildNodes() )
>         {
>             tableElement.appendChild( tableHeader );
>         }
>         if ( tableBody.hasChildNodes() )
>         {
>             tableElement.appendChild( tableBody );
>             flow.appendChild( tableElement );
>         }
>         else
>         {
>             logger.log(bla-bla);
>         }
> }
> 
> 
> and at last you need to do:
> 
> flow.appendChild(tableElement);
> 
> otherwise you table will be without correct father

Sorry, was wrong: as I understand later there is one symbol like space " " in word document, that represents as range witch papx.toByteArray() is really [0,0,0,0,0] that's why your analizes think that range out of table and that's why stop table at that symbol.