ogma-language-xmlspec-1.6.0: Ogma: Runtime Monitor translator: XML Frontend
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.XMLSpec.PrintTrees

Description

Print XML trees.

This variant of the function to show XML trees available in HXT is needed because of issues with values being quoted by HXT's default function.

It's based on the same ideas, but it's been implemented using the pretty-library instead of using plain string functions.

Synopsis

Documentation

flattenDoc :: Doc -> String Source #

Render a document into a string.

class Pretty x where Source #

Class for values that can be converted into a document.

Methods

pretty :: x -> Doc Source #

Instances

Instances details
Pretty QName Source # 
Instance details

Defined in Language.XMLSpec.PrintTrees

Methods

pretty :: QName -> Doc Source #

Pretty XmlTree Source # 
Instance details

Defined in Language.XMLSpec.PrintTrees

Methods

pretty :: XmlTree -> Doc Source #

Pretty [XmlTree] Source # 
Instance details

Defined in Language.XMLSpec.PrintTrees

Methods

pretty :: [XmlTree] -> Doc Source #

Pretty (String, Attributes) Source # 
Instance details

Defined in Language.XMLSpec.PrintTrees

Pretty (DTDElem, Attributes, XmlTrees) Source # 
Instance details

Defined in Language.XMLSpec.PrintTrees

Auxiliary functions related to pretty printing XML trees.

prettyAttr :: String -> Attributes -> Doc Source #

Pretty print an attribute followed by its value.

prettyContent :: XmlTree -> Doc Source #

Pretty print a content element.

prettyElemType :: String -> XmlTrees -> Doc Source #

Pretty print the type of an element.

prettyEntity :: String -> Attributes -> XmlTrees -> Doc Source #

Pretty print an entity.

prettyLiteralTrees :: XmlTrees -> Doc Source #

Pretty print trees as text, quoting them.

prettyExternalId :: Attributes -> Doc Source #

Pretty print an external ID.

prettyPEAttr :: Attributes -> Doc Source #

Pretty print a Parameter Entity Reference.

prettyValue :: Attributes -> XmlTrees -> Doc Source #

Given a list of attributes, pretty print the value in them.

Generic document constructors

slash :: Doc Source #

Forward slash character.

nl :: Doc Source #

New line character.

angles :: Doc -> Doc Source #

Enclose document in angle brackets.

(<|>) :: Doc -> Doc -> Doc Source #

Compose two documents, separating them by a new line.

The new line is not inserted if either document is empty.

sepBy Source #

Arguments

:: Doc

Separator

-> [Doc]

List of documents

-> Doc 

Concatenate a list od documents, separating them by a given separator.