Chris@0: # The Serializer (Writer) Model Chris@0: Chris@0: The serializer roughly follows sections _8.1 Writing HTML documents_ and section Chris@0: _8.3 Serializing HTML fragments_ by converting DOMDocument, DOMDocumentFragment, Chris@0: and DOMNodeList into HTML5. Chris@0: Chris@0: [ HTML5 ] // Interface for saving. Chris@0: || Chris@0: [ Traverser ] // Walk the DOM Chris@0: || Chris@0: [ Rules ] // Convert DOM elements into strings. Chris@0: || Chris@0: [ HTML5 ] // HTML5 document or fragment in text. Chris@0: Chris@0: Chris@0: ## HTML5 Class Chris@0: Chris@0: Provides the top level interface for saving. Chris@0: Chris@0: ## The Traverser Chris@0: Chris@0: Walks the DOM finding each element and passing it off to the output rules to Chris@0: convert to HTML5. Chris@0: Chris@0: ## Output Rules Chris@0: Chris@0: The output rules are defined in the RulesInterface which can have multiple Chris@0: implementations. Currently, the OutputRules is the default implementation that Chris@0: converts a DOM as is into HTML5. Chris@0: Chris@0: ## HTML5 String Chris@0: Chris@0: The output of the process it HTML5 as a string or saved to a file.