Wiki

Clone wiki

SortingV2 / Formatters

Home

#Formatters In addition to the default XML formatter, this project includes two additional formatters.

##XmlSmallNodeFormatter This is a variation fo the XML formatter, but it formats the parameter trace data as attribute key / values in the XML output.

This formatter makes extensive use of the INodeMultiTagParser interface to decide how each TraceNode is formatted.

If a specific parser does not exists for a TraceNode, it falls back to the standard XmlNodeParser.

##HtmlNodeFormatter This formatter is designed to extract the trace data, and create HTML.

It extensively uses INodeTaggedParser interface to specify its parsers. Furthermore, it also uses the ParserMap to control what parsers are allowed to to be active at any given time. This allows different algorithms to format subnodes in different manners even though the subnodes may have the same tag.

In some cases, the same parser code may be associated with more than one tag. Instead of using INodeMultiTagParser, we keep using INodeTaggedParser, derive from the other class, and merely override the Tag field. We do this since we want to keep strict control over what tags are visible.

Another important aspect of this formatter is that it extensively uses the ParserMap and the ParserMap.Memento classes to control which specific tags may be parsed, as well as how the data will be parsed.

Updated