HaXml-1.25.5: Utilities for manipulating XML documents

Safe Haskell | None
Language | Haskell98

Text.XML.HaXml.XmlContent.Haskell

Contents

- Re-export everything from Text.XML.HaXml.XmlContent.Parser.
- Instances (only) for the XmlContent class, for datatypes that
- Whole-document conversion functions
- Orphan instances

Description

The class `XmlContent` is a kind of replacement for Read and Show: it provides conversions between a generic XML tree representation and your own more specialised typeful Haskell data trees.

If you are starting with a set of Haskell datatypes, use DrIFT to derive instances of this class for you: http://repetae.net/john/computer/haskell/DrIFT and use the current module for instances of the standard Haskell datatypes list, Maybe, and so on.

If you are starting with an XML DTD, use HaXml's tool DtdToHaskell to generate both the Haskell types and the corresponding instances, but _do_not_ use the current module for instances: use Text.XML.HaXml.XmlContent instead.

Synopsis

- module Text.XML.HaXml.XmlContent.Parser
- toXml :: XmlContent a => Bool -> a -> Document ()
- fromXml :: XmlContent a => Document Posn -> Either String a
- readXml :: XmlContent a => String -> Either String a
- showXml :: XmlContent a => Bool -> a -> String
- fpsShowXml :: XmlContent a => Bool -> a -> ByteString
- fReadXml :: XmlContent a => FilePath -> IO a
- fWriteXml :: XmlContent a => FilePath -> a -> IO ()
- fpsWriteXml :: XmlContent a => FilePath -> a -> IO ()
- hGetXml :: XmlContent a => Handle -> IO a
- hPutXml :: XmlContent a => Handle -> Bool -> a -> IO ()
- fpsHPutXml :: XmlContent a => Handle -> Bool -> a -> IO ()

# Re-export everything from Text.XML.HaXml.XmlContent.Parser.

module Text.XML.HaXml.XmlContent.Parser

# Instances (only) for the XmlContent class, for datatypes that

# Whole-document conversion functions

toXml :: XmlContent a => Bool -> a -> Document () #

Convert a fully-typed XML document to a string (with or without DTD).

fromXml :: XmlContent a => Document Posn -> Either String a #

Read a Haskell value from an XML document, ignoring the DTD and using the Haskell result type to determine how to parse it.

readXml :: XmlContent a => String -> Either String a #

Read a fully-typed XML document from a string.

showXml :: XmlContent a => Bool -> a -> String #

Convert a fully-typed XML document to a string (without DTD).

fpsShowXml :: XmlContent a => Bool -> a -> ByteString #

Convert a fully-typed XML document to a ByteString (without DTD).

fReadXml :: XmlContent a => FilePath -> IO a #

Read an XML document from a file and convert it to a fully-typed Haskell value.

fWriteXml :: XmlContent a => FilePath -> a -> IO () #

Write a fully-typed Haskell value to the given file as an XML document.

fpsWriteXml :: XmlContent a => FilePath -> a -> IO () #

Write any Haskell value to the given file as an XML document, using the FastPackedString interface (output will not be prettified).

hGetXml :: XmlContent a => Handle -> IO a #

Read a fully-typed XML document from a file handle.

hPutXml :: XmlContent a => Handle -> Bool -> a -> IO () #

Write a fully-typed XML document to a file handle.

fpsHPutXml :: XmlContent a => Handle -> Bool -> a -> IO () #

Write a fully-typed XML document to a file handle, using the FastPackedString interface (output will not be prettified).

# Orphan instances

XmlContent Bool # |
Instance details Methods parseContents :: XMLParser Bool # toContents :: Bool -> [Content ()] # xToChar :: Bool -> Char # xFromChar :: Char -> Bool #
XmlContent Char # |
Instance details Methods parseContents :: XMLParser Char # toContents :: Char -> [Content ()] # xToChar :: Char -> Char # xFromChar :: Char -> Char #
XmlContent Double # |
Instance details Methods parseContents :: XMLParser Double # toContents :: Double -> [Content ()] # xToChar :: Double -> Char # xFromChar :: Char -> Double #
XmlContent Float # |
Instance details Methods parseContents :: XMLParser Float # toContents :: Float -> [Content ()] # xToChar :: Float -> Char # xFromChar :: Char -> Float #
XmlContent Int # |
Instance details Methods parseContents :: XMLParser Int # toContents :: Int -> [Content ()] # xToChar :: Int -> Char # xFromChar :: Char -> Int #
XmlContent Integer # |
Instance details Methods parseContents :: XMLParser Integer # toContents :: Integer -> [Content ()] # xToChar :: Integer -> Char # xFromChar :: Char -> Integer #
XmlContent () # |
Instance details Methods parseContents :: XMLParser () # toContents :: () -> [Content ()] # xToChar :: () -> Char # xFromChar :: Char -> () #
XmlContent a => XmlContent [a] # |
Instance details Methods parseContents :: XMLParser [a] # toContents :: [a] -> [Content ()] # xToChar :: [a] -> Char # xFromChar :: Char -> [a] #
XmlContent a => XmlContent (Maybe a) # |
Instance details Methods parseContents :: XMLParser (Maybe a) # toContents :: Maybe a -> [Content ()] # xToChar :: Maybe a -> Char # xFromChar :: Char -> Maybe a #
(XmlContent a, XmlContent b) => XmlContent (Either a b) # |
Instance details Methods parseContents :: XMLParser (Either a b) # toContents :: Either a b -> [Content ()] # xToChar :: Either a b -> Char # xFromChar :: Char -> Either a b #