Copyright | (c) Ewaryst Schulz DFKI 2009 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | ewaryst.schulz@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
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
- omdoc_current_version :: String
- toQN :: String -> QName
- toQNOM :: String -> QName
- el_omdoc :: QName
- el_theory :: QName
- el_view :: QName
- el_structure :: QName
- el_type :: QName
- el_adt :: QName
- el_sortdef :: QName
- el_constructor :: QName
- el_argument :: QName
- el_insort :: QName
- el_selector :: QName
- el_open :: QName
- el_component :: QName
- el_conass :: QName
- el_constant :: QName
- el_notation :: QName
- el_text :: QName
- el_definition :: QName
- el_omobj :: QName
- el_ombind :: QName
- el_oms :: QName
- el_ombvar :: QName
- el_omattr :: QName
- el_omatp :: QName
- el_omv :: QName
- el_oma :: QName
- at_version :: QName
- at_module :: QName
- at_name :: QName
- at_meta :: QName
- at_role :: QName
- at_type :: QName
- at_total :: QName
- at_for :: QName
- at_from :: QName
- at_to :: QName
- at_value :: QName
- at_base :: QName
- at_as :: QName
- at_precedence :: QName
- at_fixity :: QName
- at_index :: QName
- at_associativity :: QName
- at_style :: QName
- at_implicit :: QName
- attr_om :: Attr
- class XmlRepresentable a where
- xmlOut :: XmlRepresentable a => a -> String
- xmlIn :: XmlParseable a => a -> IO (Result OMDoc)
- listToXml :: XmlRepresentable a => [a] -> [Content]
- listFromXml :: XmlRepresentable a => [Content] -> Result [a]
- mkElement :: QName -> [Attr] -> [Content] -> Content
- makeComment :: String -> Content
- inAContent :: QName -> [Attr] -> Maybe Content -> Content
- inContent :: QName -> Maybe Content -> Content
- toOmobj :: Content -> Content
- urlEscape :: String -> String
- urlUnescape :: String -> String
- showCDName :: OMCD -> OMName -> String
- showCD :: OMCD -> String
- showOMName :: OMName -> String
- readCD :: Show a => a -> String -> OMCD
- readCDName :: String -> OMQualName
- readOMName :: String -> OMName
- tripleEncodeOMS :: OMCD -> OMName -> [Attr]
- pairEncodeCD :: OMCD -> [Attr]
- tripleDecodeOMS :: String -> String -> String -> (OMCD, OMName)
- warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b
- warnIf :: String -> Bool -> Result ()
- elemIsOf :: Element -> QName -> Bool
- oneOfMsg :: Element -> [QName] -> String
- justReturn :: Monad m => a -> m (Maybe a)
- fmapMaybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
- fmapFromMaybe :: Monad m => (a -> m (Maybe b)) -> Maybe a -> m (Maybe b)
- encapsMaybe :: Monad m => Maybe (m a) -> m (Maybe a)
- flattenMaybe :: Monad m => m (Maybe (Maybe a)) -> m (Maybe a)
- missingMaybe :: String -> String -> Maybe a -> a
- omelementFrom :: QName -> Element -> Result (Maybe OMElement)
- omelementFromOmobj :: Element -> Result (Maybe OMElement)
- omobjToOMElement :: Element -> Result OMElement
- xmlToAssignment :: Element -> Result (OMName, OMImage)
- typeToXml :: OMElement -> Content
- assignmentToXml :: (OMName, OMImage) -> Content
- constantToXml :: String -> String -> OMElement -> Maybe OMElement -> Content
- notationComponentToXml :: NotationComponent -> Content
Names and other constants
omdoc_current_version :: String Source #
The implemented OMDoc version
el_structure :: 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_selector :: QName Source #
often used element names
el_component :: QName Source #
often used element names
el_constant :: QName Source #
often used element names
el_notation :: QName Source #
often used element names
el_definition :: QName Source #
often used element names
at_version :: QName Source #
at_precedence :: QName Source #
at_associativity :: QName Source #
at_implicit :: QName Source #
Top level from/to xml functions
class XmlRepresentable a where Source #
This class defines the interface to read from and write to XML
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 |
XmlRepresentable OMAttribute Source # | Helper instance for OpenMath attributes |
Defined in OMDoc.XmlInterface toXml :: OMAttribute -> Content Source # fromXml :: Element -> Result (Maybe OMAttribute) Source # | |
XmlRepresentable OmdADT Source # | OMDoc - Algebraic Data Types |
XmlRepresentable TCElement Source # | theory constitutive OMDoc elements to XML and back |
XmlRepresentable TLElement Source # | toplevel OMDoc elements to XML and back |
XmlRepresentable OMDoc Source # | The root instance for representing OMDoc in XML |
xmlOut :: XmlRepresentable a => a -> String Source #
listToXml :: XmlRepresentable a => [a] -> [Content] Source #
listFromXml :: XmlRepresentable a => [Content] -> Result [a] Source #
makeComment :: String -> Content Source #
inAContent :: QName -> [Attr] -> Maybe Content -> Content Source #
Encoding/Decoding
urlUnescape :: String -> String Source #
showCDName :: OMCD -> OMName -> String Source #
showOMName :: OMName -> String Source #
readCDName :: String -> OMQualName Source #
readOMName :: String -> OMName Source #
tripleEncodeOMS :: OMCD -> OMName -> [Attr] Source #
pairEncodeCD :: OMCD -> [Attr] Source #
tripleDecodeOMS :: String -> String -> String -> (OMCD, OMName) Source #
warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b Source #
Monad and Maybe interaction
justReturn :: Monad m => a -> m (Maybe a) 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.
omelementFromOmobj :: Element -> Result (Maybe OMElement) Source #
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
assignmentToXml :: (OMName, OMImage) -> Content Source #
constantToXml :: String -> String -> OMElement -> Maybe OMElement -> Content Source #
notationComponentToXml :: NotationComponent -> Content Source #