HTML Serializer

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=""/> <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" ""> <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.