HTML Serializer

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"> <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public> <doctype-system></doctype-system> <encoding>iso-8859-1</encoding> </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 – 2017 Hugh Field-Richards. All Rights Reserved.