Class HtmlExporterNG2

java.lang.Object
org.docx4j.convert.out.html.AbstractHtmlExporter
org.docx4j.convert.out.html.HtmlExporterNG2
All Implemented Interfaces:
Output

public class HtmlExporterNG2
extends AbstractHtmlExporter
Deprecated.
HtmlExporterNG (now removed - see http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/convert/out/html/HtmlExporterNG.java?rev=1238 ) had 2 salient features: 1. CSS .xx_pPr and .xx_rPr are created / split out for each docx paragraph style 2. Each docx style is resolved into its effective style, by the PropertyResolver When roundtripping HTML content, this had adverse consequences (neither too bad, but adding to our work): (a) It is harder to tell what has been added to the style definition in an editor (if/when that is possible) (b) Have to convert .xx_pPr and .xx_rPr back to xx Also, we're not really taking advantage of the ability of CSS to cascade. So this HtmlExporterNG2 takes a different approach. It creates a css definition for each style in use (either directly or indirectly), and in the document, on the element's class attribute, puts the set of style names in the hierarchy into . The CSS rules are written in a depth or breadth first traversal of the style graph, so that conflicts are handled correctly. TODO: handle document defaults.
Author:
jason
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.docx4j.convert.out.html.AbstractHtmlExporter

    AbstractHtmlExporter.HtmlSettings
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static int DEFAULT_OUTPUT_SIZE
    Deprecated.
     
    protected static org.slf4j.Logger log
    Deprecated.
     
  • Constructor Summary

    Constructors 
    Constructor Description
    HtmlExporterNG2()
    Deprecated.
     
  • Method Summary

    Modifier and Type Method Description
    void html​(WordprocessingMLPackage wmlPackage, javax.xml.transform.Result result, HTMLSettings htmlSettings)
    Deprecated.
    Create an html version of the document.
    void output​(javax.xml.transform.Result result)
    Deprecated.
     
    void setHtmlSettings​(HTMLSettings htmlSettings)
    Deprecated.
     
    void setWmlPackage​(WordprocessingMLPackage wmlPackage)
    Deprecated.
     
    static void setXslt​(javax.xml.transform.Templates xslt)
    Deprecated.
    org/docx4j/convert/out/html/docx2xhtmlNG2.xslt will be used by default to transform the docx to html.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • setWmlPackage

      public void setWmlPackage​(WordprocessingMLPackage wmlPackage)
      Deprecated.
    • setHtmlSettings

      public void setHtmlSettings​(HTMLSettings htmlSettings)
      Deprecated.
    • setXslt

      public static void setXslt​(javax.xml.transform.Templates xslt)
      Deprecated.
      org/docx4j/convert/out/html/docx2xhtmlNG2.xslt will be used by default to transform the docx to html. This method allows you to use your own xslt instead.
      Parameters:
      xslt -
    • output

      public void output​(javax.xml.transform.Result result) throws Docx4JException
      Deprecated.
      Throws:
      Docx4JException
    • html

      public void html​(WordprocessingMLPackage wmlPackage, javax.xml.transform.Result result, HTMLSettings htmlSettings) throws java.lang.Exception
      Deprecated.
      Create an html version of the document.
      Specified by:
      html in class AbstractHtmlExporter
      Parameters:
      result - The javax.xml.transform.Result object to transform into
      Throws:
      java.lang.Exception