bellakhalAmir / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

XHTML generation: The parent tag of inline image (like <p>) is not closed #434

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. try to generate XHTML using attached docx and png

What is the expected output? 
<div 
style="width:595.0pt;margin-bottom:72.0pt;margin-top:72.0pt;margin-left:72.0pt;m
argin-right:72.0pt;">
        <p>
            <img src="/word/media/image1.png" width="161.35323pt" height="87.05874pt"/>
        </p>
    </div>

What do you see instead?
<div 
style="width:595.0pt;margin-bottom:72.0pt;margin-top:72.0pt;margin-left:72.0pt;m
argin-right:72.0pt;">
        <p>
            <img src="/word/media/image1.png" width="161.35323pt" height="87.05874pt"/>
        </div>

I suggest that XHTMLMapper#visitPicture would close the "img" tag immediately, 
see line 458-462 (or does the mapper expect the "img" element to have some 
children nodes?): i.e:
        if ( attributes != null )
        {
            startElement( IMG_ELEMENT, attributes );
            endElement(IMG_ELEMENT);
        }

What version of the product are you using? On what operating system?
1.0.5-SNAPSHOT, Win7x64, JDK 1.7_67

Please provide any additional information below.

I`m really exited about the features the xdocreport provides and 
extended XHTML conversion to produce JSF/Facelets templates. But the Facelet 
templates require the XML to be well-formed (not like a usual lax HTML browser 
parsers) 

Original issue reported on code.google.com by petr.and...@gmail.com on 18 Aug 2014 at 11:44

Attachments:

GoogleCodeExporter commented 8 years ago
Thank's for the code snippet fix.

I have fixed that. See 
https://code.google.com/p/xdocreport/source/detail?r=5274f7f6a06bbbb3f9b7ea8d7c5
a94a3b684d381

Original comment by angelo.z...@gmail.com on 18 Aug 2014 at 1:08

GoogleCodeExporter commented 8 years ago
Thank you!

Original comment by petr.and...@gmail.com on 18 Aug 2014 at 1:36