Hets - the Heterogeneous Tool Set

Copyright(c) Ewaryst Schulz DFKI 2009
LicenseGPLv2 or higher, see LICENSE.txt
Maintainerewaryst.schulz@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellNone

OMDoc.XmlInterface

Contents

Description

The transformation of the OMDoc intermediate representation to and from xml. The import from xml does not validate the xml, hence if you encounter strange errors, do not forget to check the xml structure first.

Synopsis

Names and other constants

omdoc_current_version :: String Source #

The implemented OMDoc version

toQN :: String -> QName Source #

toQNOM :: String -> QName Source #

el_omdoc :: QName Source #

often used element names

el_theory :: QName Source #

often used element names

el_view :: QName Source #

often used element names

el_structure :: QName Source #

often used element names

el_type :: QName Source #

often used element names

el_adt :: QName Source #

often used element names

el_sortdef :: QName Source #

often used element names

el_constructor :: QName Source #

often used element names

el_argument :: QName Source #

often used element names

el_insort :: QName Source #

often used element names

el_selector :: QName Source #

often used element names

el_open :: QName Source #

often used element names

el_component :: QName Source #

often used element names

el_conass :: QName Source #

often used element names

el_constant :: QName Source #

often used element names

el_notation :: QName Source #

often used element names

el_text :: QName Source #

often used element names

el_definition :: QName Source #

often used element names

el_omobj :: QName Source #

often used element names

el_ombind :: QName Source #

often used element names

el_oms :: QName Source #

often used element names

el_ombvar :: QName Source #

often used element names

el_omattr :: QName Source #

often used element names

el_omatp :: QName Source #

often used element names

el_omv :: QName Source #

often used element names

el_oma :: QName Source #

often used element names

at_module :: QName Source #

at_name :: QName Source #

at_meta :: QName Source #

at_role :: QName Source #

at_type :: QName Source #

at_total :: QName Source #

at_for :: QName Source #

at_from :: QName Source #

at_to :: QName Source #

at_value :: QName Source #

at_base :: QName Source #

at_as :: QName Source #

at_fixity :: QName Source #

at_index :: QName Source #

at_style :: QName Source #

attr_om :: Attr Source #

Top level from/to xml functions

class XmlRepresentable a where Source #

This class defines the interface to read from and write to XML

Minimal complete definition

toXml, fromXml

Methods

toXml :: a -> Content Source #

render instance to an XML Element

fromXml :: Element -> Result (Maybe a) Source #

read instance from an XML Element

Instances

XmlRepresentable OMElement Source #

OpenMath elements to XML and back

Methods

toXml :: OMElement -> Content Source #

fromXml :: Element -> Result (Maybe OMElement) Source #

XmlRepresentable OMAttribute Source #

Helper instance for OpenMath attributes

Methods

toXml :: OMAttribute -> Content Source #

fromXml :: Element -> Result (Maybe OMAttribute) Source #

XmlRepresentable OmdADT Source #

OMDoc - Algebraic Data Types

Methods

toXml :: OmdADT -> Content Source #

fromXml :: Element -> Result (Maybe OmdADT) Source #

XmlRepresentable TCElement Source #

theory constitutive OMDoc elements to XML and back

Methods

toXml :: TCElement -> Content Source #

fromXml :: Element -> Result (Maybe TCElement) Source #

XmlRepresentable TLElement Source #

toplevel OMDoc elements to XML and back

Methods

toXml :: TLElement -> Content Source #

fromXml :: Element -> Result (Maybe TLElement) Source #

XmlRepresentable OMDoc Source #

The root instance for representing OMDoc in XML

Methods

toXml :: OMDoc -> Content Source #

fromXml :: Element -> Result (Maybe OMDoc) Source #

xmlOut :: XmlRepresentable a => a -> String Source #

listToXml :: XmlRepresentable a => [a] -> [Content] Source #

listFromXml :: XmlRepresentable a => [Content] -> Result [a] Source #

mkElement :: QName -> [Attr] -> [Content] -> Content Source #

makeComment :: String -> Content Source #

inAContent :: QName -> [Attr] -> Maybe Content -> Content Source #

inContent :: QName -> Maybe Content -> Content Source #

toOmobj :: Content -> Content Source #

Encoding/Decoding

urlEscape :: String -> String Source #

urlUnescape :: String -> String Source #

showCDName :: OMCD -> OMName -> String Source #

showCD :: OMCD -> String Source #

showOMName :: OMName -> String Source #

readCD :: Show a => a -> String -> OMCD Source #

readOMName :: String -> OMName Source #

pairEncodeCD :: OMCD -> [Attr] Source #

tripleDecodeOMS :: String -> String -> String -> (OMCD, OMName) Source #

warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b Source #

warnIf :: String -> Bool -> Result () Source #

elemIsOf :: Element -> QName -> Bool Source #

oneOfMsg :: Element -> [QName] -> String Source #

Monad and Maybe interaction

justReturn :: Monad m => a -> m (Maybe a) Source #

fmapMaybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source #

fmapFromMaybe :: Monad m => (a -> m (Maybe b)) -> Maybe a -> m (Maybe b) Source #

encapsMaybe :: Monad m => Maybe (m a) -> m (Maybe a) Source #

flattenMaybe :: Monad m => m (Maybe (Maybe a)) -> m (Maybe a) Source #

missingMaybe :: String -> String -> Maybe a -> a Source #

Function to extract the Just values from maybes with a default missing error in case of Nothing

fromXml methods

omelementFrom :: QName -> Element -> Result (Maybe OMElement) Source #

If the child element with given name contains an OMOBJ xml element, this is transformed to an OMElement.

omobjToOMElement :: Element -> Result OMElement Source #

Get an OMElement from an OMOBJ xml element

xmlToAssignment :: Element -> Result (OMName, OMImage) Source #

The input is assumed to be a conass element

toXml methods

typeToXml :: OMElement -> Content Source #

constantToXml :: String -> String -> OMElement -> Maybe OMElement -> Content Source #