Package org.ametys.core.cocoon
Class XHTMLSerializer
- All Implemented Interfaces:
Poolable
,Recyclable
,Component
,Configurable
,LogEnabled
,Serviceable
,Serializer
,SitemapOutputComponent
,XMLConsumer
,XMLConsumer
,ContentHandler
,LexicalHandler
,Locator
Inherits from cocoon's serializers block XHTMLSerializer.
If there is no such configuration, default tags to collaspe are:
The following configuration can be used:
<omit-xml-declaration>yes|no</omit-xml-declaration> <tags-to-collapse>input,meta</tags-to-collapse> <namespace-allowed></namespace-allowed> <namespace-allowed>http://www.w3.org/XML/1998/namespace</namespace-allowed> <namespace-allowed>http://www.w3.org/1999/xhtml</namespace-allowed>Empty tags are not collapsed except the ones configured with
tags-to-collapse
.If there is no such configuration, default tags to collaspe are:
- input
- img
- meta
- link
- hr
- br
namespace-allowed
, by default
the only following namespaces are allowed:
- "" (empty namespace)
- "http://www.w3.org/XML/1998/namespace"
- "http://www.w3.org/1999/xhtml"
- "http://www.w3.org/2000/svg"
- "http://www.w3.org/1998/Math/MathML"
script
tags will be exported in a single comment.
omit-xml-declaration
is set to yes
by default for
compatibility purpose (IE 6).
If omit-xml-declaration
is set to no
,
Content-Type
meta tag will be dropped if present.
- Since:
- 1.1.5 this serializer is JAXP compliant with the processing instruction
javax.xml.transform.*-output-escaping processing
. - See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected XHTMLSerializerExtensionPoint
The XHTMLSerializerExtensionPoint instanceFields inherited from class org.apache.cocoon.components.serializers.XHTMLSerializer
doctype_default, encodeCharacters, XHTML1_DOCTYPE_FRAMESET, XHTML1_DOCTYPE_STRICT, XHTML1_DOCTYPE_TRANSITIONAL, XHTML1_NAMESPACE, XHTML5_DOCTYPE
Fields inherited from class org.apache.cocoon.components.serializers.XMLSerializer
doctype
Fields inherited from class org.apache.cocoon.components.serializers.EncodingSerializer
ATTRIBUTE_LENGTH, ATTRIBUTE_LOCAL, ATTRIBUTE_NSURI, ATTRIBUTE_QNAME, ATTRIBUTE_VALUE, charset, indentPerLevel, namespaces
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
charactersImpl
(char[] data, int start, int length) void
comment
(char[] data, int start, int length) void
configure
(Configuration conf) void
enableLogging
(Logger logger) void
endElement
(String nsuri, String local, String qual) void
endElementImpl
(String uri, String local, String qual) void
endPrefixMapping
(String prefix) void
ignorableWhitespace
(char[] data, int start, int length) void
processingInstruction
(String target, String data) void
recycle()
void
service
(ServiceManager manager) void
startElement
(String nsuri, String local, String qual, Attributes attributes) void
startElementImpl
(String uri, String local, String qual, String[][] lNamespaces, String[][] attributes) void
startPrefixMapping
(String prefix, String uri) Methods inherited from class org.apache.cocoon.components.serializers.XHTMLSerializer
body, encode, getMimeType, head, isCdataElement
Methods inherited from class org.apache.cocoon.components.serializers.XMLSerializer
closeElement, endCDATA, endDocument, endDTD, endEntity, skippedEntity, startCDATA, startDocument, startDTD, startEntity
Methods inherited from class org.apache.cocoon.components.serializers.EncodingSerializer
encode, encode, flush, getColumnNumber, getLineNumber, getLocation, getPublicId, getSystemId, setDocumentLocator, setOutputStream, shouldSetContentLength, 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
declaration
-
Field Details
-
_xhtmlSerializerExtensionPoint
The XHTMLSerializerExtensionPoint instance
-
-
Constructor Details
-
XHTMLSerializer
public XHTMLSerializer()
-
-
Method Details
-
enableLogging
- Specified by:
enableLogging
in interfaceLogEnabled
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classXHTMLSerializer
- Throws:
ConfigurationException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classEncodingSerializer
- Throws:
SAXException
-
startElement
public void startElement(String nsuri, String local, String qual, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classEncodingSerializer
- Throws:
SAXException
-
startElementImpl
public void startElementImpl(String uri, String local, String qual, String[][] lNamespaces, String[][] attributes) throws SAXException - Overrides:
startElementImpl
in classXHTMLSerializer
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classEncodingSerializer
- Throws:
SAXException
-
charactersImpl
- Overrides:
charactersImpl
in classXMLSerializer
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Overrides:
ignorableWhitespace
in classXMLSerializer
- Throws:
SAXException
-
comment
- Specified by:
comment
in interfaceLexicalHandler
- Overrides:
comment
in classXMLSerializer
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classXMLSerializer
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classEncodingSerializer
- Throws:
SAXException
-
endElementImpl
- Overrides:
endElementImpl
in classXHTMLSerializer
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classEncodingSerializer
- Throws:
SAXException
-
recycle
- Specified by:
recycle
in interfaceRecyclable
- Overrides:
recycle
in classXMLSerializer
-