HTML Serializer

Warning
Note that this is a change from all versions prior to 1.13.0.

The HTMLSerializer outputs a plain HTML stream suitable for most browsers. A typical use of HTMLSerializer would be

<map:components> ... <map:serializers default="xml"> <map:serializer name="html" mime-type="text/html" src="resource://lib/serialization/HTMLSerializer"> <map:property name="doctype-public" value="-//W3C//DTD HTML 4.01 Transitional//EN"/> <map:property name="doctype-system" value="http://www.w3.org/TR/html4/loose.dtd"/> <map:property name="encoding" value="UTF-8"/> </map:serializer> </map:serializers> </map:components> <map:pipelines> <map:pipeline> <map:match pattern="*.html"> <!-- generate --> <!-- some transformations --> <map:serialize type="html"/> </map:match> </map:pipeline> </map:pipelines>

Given that the last transformer gave HTML as an output the HTML serializer would produce the following typical output:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- Remaining head tags from DOM --> </head> <body> <!-- Remaining body tags from DOM --> </body> </html>
Copyright 2006 – 2023 Hugh Field-Richards. All Rights Reserved.