Package org.apache.sling.rewriter.impl.components

## Class HtmlSerializerFactory.HTMLSerializer

- java.lang.Object
- - org.apache.cocoon.components.serializers.util.EncodingSerializer
  - - org.apache.cocoon.components.serializers.util.XMLSerializer
    - - org.apache.cocoon.components.serializers.util.XHTMLSerializer
      - - org.apache.cocoon.components.serializers.util.HTMLSerializer
        - - org.apache.sling.rewriter.impl.components.HtmlSerializerFactory.HTMLSerializer

All Implemented Interfaces:
  `Serializer`, `ContentHandler`, `LexicalHandler`, `Locator`

Enclosing class:
  HtmlSerializerFactory

    public class HtmlSerializerFactory.HTMLSerializer
    extends org.apache.cocoon.components.serializers.util.HTMLSerializer
    implements Serializer

A serializer converting XHTML into plain old HTML.

For configuration options of this serializer, please look at the `XHtmlSerializerFactory` and `EncodingSerializer`.

Any of the XHTML document type declared or used will be converted into its HTML 4.01 counterpart, and in addition to those a "compatible" doctype can be supported to exploit a couple of shortcuts into MSIE's rendering engine. The values for the `doctype-default` can then be:

"`none`"
  Not to emit any dococument type declaration.
"`compatible`"
  The HTML 4.01 Transitional (exploiting MSIE shortcut).
"`strict`"
  The HTML 4.01 Strict document type.
"`loose`"
  The HTML 4.01 Transitional document type.
"`frameset`"
  The HTML 4.01 Frameset document type.

### Field Summary

### Fields inherited from class org.apache.cocoon.components.serializers.util.HTMLSerializer

`HTML401_DOCTYPE_COMPATIBLE, HTML401_DOCTYPE_FRAMESET, HTML401_DOCTYPE_STRICT, HTML401_DOCTYPE_TRANSITIONAL`

### Fields inherited from class org.apache.cocoon.components.serializers.util.XHTMLSerializer

`doctype_default, encodeCharacters, XHTML1_DOCTYPE_FRAMESET, XHTML1_DOCTYPE_STRICT, XHTML1_DOCTYPE_TRANSITIONAL, XHTML1_NAMESPACE`

### Fields inherited from class org.apache.cocoon.components.serializers.util.XMLSerializer

`doctype`

### Fields inherited from class org.apache.cocoon.components.serializers.util.EncodingSerializer

`ATTRIBUTE_LENGTH, ATTRIBUTE_LOCAL, ATTRIBUTE_NSURI, ATTRIBUTE_QNAME, ATTRIBUTE_VALUE, charset, CONTENT_LIST_ATTRIBUTE, indentPerLevel, NAMESPACE, namespaces, request`

### Constructor Summary

Constructors
`HTMLSerializer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `dispose()` Dispose the serializer.
`void` `init​(ProcessingContext context, ProcessingComponentConfiguration config)` Initialize this component.

### Methods inherited from class org.apache.cocoon.components.serializers.util.HTMLSerializer

`body, endElementImpl, head, setDoctypeDefault, startElementImpl`

### Methods inherited from class org.apache.cocoon.components.serializers.util.XHTMLSerializer

`encode, getMimeType, isCdataElement, setOmitXmlDeclaration`

### Methods inherited from class org.apache.cocoon.components.serializers.util.XMLSerializer

`charactersImpl, closeElement, comment, endCDATA, endDocument, endDTD, endEntity, ignorableWhitespace, processingInstruction, recycle, skippedEntity, startCDATA, startDocument, startDTD, startEntity`

### Methods inherited from class org.apache.cocoon.components.serializers.util.EncodingSerializer

`characters, encode, encode, endElement, endPrefixMapping, flush, getColumnNumber, getLineNumber, getLocation, getPublicId, getSystemId, include, setDocumentLocator, setEncoding, setIndentPerLevel, setOutputStream, setup, startElement, startPrefixMapping, write, write, write, write, write, writeIndent, writeln, writeln`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.xml.sax.ContentHandler

`characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping`

### Constructor Detail

#### HTMLSerializer

    public HTMLSerializer()

### Method Detail

#### init

    public void init​(ProcessingContext context,
                     ProcessingComponentConfiguration config)
              throws IOException

Description copied from interface: `Serializer`
Initialize this component.

Specified by:
  `init` in interface `Serializer`
Parameters:
  `context` - The invocation context.
  `config` - The configuration for this component.
Throws:
  `IOException` - in case of problems
See Also:
  `Serializer.init(org.apache.sling.rewriter.ProcessingContext, org.apache.sling.rewriter.ProcessingComponentConfiguration)`

#### dispose

    public void dispose()

Description copied from interface: `Serializer`
Dispose the serializer. This method is always invoked by the rewriter in order to allow the serializer to release any resources etc. After this method has been called the instance is considered unusable.

Specified by:
  `dispose` in interface `Serializer`
See Also:
  `Serializer.dispose()`