Page 1 of 1

org.docx4j.convert.out.html.DocX2html.xslt Issue?

PostPosted: Mon Jun 22, 2009 5:14 am
by Leigh
Hi,

I am not sure if this a legitimate issue, or I just do not have the latest sources. In my version of DocX2html.xslt, line 3364 references the HtmlExporter class. But from what I can tell, the createImgE10(..) method was moved to the newer WordXmlPicture class.

org.docx4j.convert.out.html.DocX2html.xslt (around line 3364)
Code: Select all
<xsl:copy-of select="java:org.docx4j.convert.out.html.HtmlExporter.createImgE10( $wmlPackage, string($imageDirPath), ....


I updated my local file to point to the newer class

Code: Select all
     <xsl:copy-of select="java:org.docx4j.model.images.WordXmlPicture.createImgE10( $wmlPackage, string($imageDirPath), ...


It seems to be working so far. But I did notice createImgE10 throws a NullPointerException when shape.nextNode() is null. So maybe the createImgE10 method should verify shape.nextNode() is not null before proceeding?

Class: org.docx4j.model.images.WordXmlPicture (around line 339)
Code: Select all
    public static DocumentFragment createImgE10(WordprocessingMLPackage wmlPackage,
          String imageDirPath,
          NodeIterator shape, NodeIterator imageData) {
       
       WordXmlPicture picture = new WordXmlPicture();
        // exception occurs inside readStandardAttributes method
       picture.readStandardAttributes( shape.nextNode() );

    }


Can anyone confirm this?

-Leigh

Re: org.docx4j.convert.out.html.DocX2html.xslt Issue?

PostPosted: Mon Jun 22, 2009 1:56 pm
by jason
Hi Leigh

Thanks for the report.

I've updated the old XSLT so it only calls the extension function if w:pict contains ./v:shape/v:imagedata

See http://dev.plutext.org/trac/docx4j/changeset/842

cheers

Jason

Re: org.docx4j.convert.out.html.DocX2html.xslt Issue?

PostPosted: Tue Jun 23, 2009 4:01 am
by Leigh
Thanks Jason!

-Leigh