Copyright | Copyright (C) 2007 Galois Inc. 2021-2023 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This code is taken from xml-light, released under the BSD3 license. It has been modified to use Text instead of String, and the fromXL* functions have been added.
Synopsis
- type Line = Integer
- data Content
- data Element = Element {}
- data Attr = Attr {}
- data CData = CData {}
- data CDataKind
- data QName = QName {}
- class Node t where
- unode :: Node t => Text -> t -> Element
- unqual :: Text -> QName
- add_attr :: Attr -> Element -> Element
- add_attrs :: [Attr] -> Element -> Element
- fromXLQName :: QName -> QName
- fromXLCData :: CData -> CData
- fromXLElement :: Element -> Element
- fromXLAttr :: Attr -> Attr
- fromXLContent :: Content -> Content
Basic types, duplicating those from xml-light but with Text
XML content
Instances
Data Content Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Content -> c Content # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Content # toConstr :: Content -> Constr # dataTypeOf :: Content -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Content) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content) # gmapT :: (forall b. Data b => b -> b) -> Content -> Content # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r # gmapQ :: (forall d. Data d => d -> u) -> Content -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Content -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Content -> m Content # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content # | |
Show Content Source # | |
Eq Content Source # | |
Ord Content Source # | |
Defined in Text.Pandoc.XML.Light.Types | |
Node Content Source # | |
Node [Content] Source # | |
Node (Attr, Content) Source # | |
Node ([Attr], Content) Source # | |
Node ([Attr], [Content]) Source # | |
XML elements
Instances
Data Element Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Element -> c Element # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Element # toConstr :: Element -> Constr # dataTypeOf :: Element -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Element) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element) # gmapT :: (forall b. Data b => b -> b) -> Element -> Element # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Element -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Element -> r # gmapQ :: (forall d. Data d => d -> u) -> Element -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Element -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Element -> m Element # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Element -> m Element # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Element -> m Element # | |
Show Element Source # | |
Eq Element Source # | |
Ord Element Source # | |
Defined in Text.Pandoc.XML.Light.Types | |
Node Element Source # | |
Node [Element] Source # | |
Node (Attr, Element) Source # | |
Node ([Attr], Element) Source # | |
Node ([Attr], [Element]) Source # | |
XML attributes
Instances
Data Attr Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Attr -> c Attr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Attr # dataTypeOf :: Attr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Attr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Attr) # gmapT :: (forall b. Data b => b -> b) -> Attr -> Attr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr -> r # gmapQ :: (forall d. Data d => d -> u) -> Attr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Attr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Attr -> m Attr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Attr -> m Attr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Attr -> m Attr # | |
Show Attr Source # | |
Eq Attr Source # | |
Ord Attr Source # | |
Node Attr Source # | |
Node [Attr] Source # | |
Node (Attr, CData) Source # | |
Node (Attr, Content) Source # | |
Node (Attr, Element) Source # | |
Node (Attr, Text) Source # | |
Node ([Attr], CData) Source # | |
Node ([Attr], Content) Source # | |
Node ([Attr], Element) Source # | |
Node ([Attr], Text) Source # | |
Node ([Attr], [CData]) Source # | |
Node ([Attr], [Content]) Source # | |
Node ([Attr], [Element]) Source # | |
XML CData
Instances
Data CData Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CData -> c CData # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CData # dataTypeOf :: CData -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CData) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CData) # gmapT :: (forall b. Data b => b -> b) -> CData -> CData # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CData -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CData -> r # gmapQ :: (forall d. Data d => d -> u) -> CData -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CData -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CData -> m CData # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CData -> m CData # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CData -> m CData # | |
Show CData Source # | |
Eq CData Source # | |
Ord CData Source # | |
Node CData Source # | |
Node [CData] Source # | |
Node (Attr, CData) Source # | |
Node ([Attr], CData) Source # | |
Node ([Attr], [CData]) Source # | |
CDataText | Ordinary character data; pretty printer escapes &, < etc. |
CDataVerbatim | Unescaped character data; pretty printer embeds it in <![CDATA[.. |
CDataRaw | As-is character data; pretty printer passes it along without any escaping or CDATA wrap-up. |
Instances
Data CDataKind Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CDataKind -> c CDataKind # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CDataKind # toConstr :: CDataKind -> Constr # dataTypeOf :: CDataKind -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CDataKind) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CDataKind) # gmapT :: (forall b. Data b => b -> b) -> CDataKind -> CDataKind # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CDataKind -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CDataKind -> r # gmapQ :: (forall d. Data d => d -> u) -> CDataKind -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CDataKind -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CDataKind -> m CDataKind # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CDataKind -> m CDataKind # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CDataKind -> m CDataKind # | |
Show CDataKind Source # | |
Eq CDataKind Source # | |
Ord CDataKind Source # | |
Defined in Text.Pandoc.XML.Light.Types |
XML qualified names
Instances
Data QName Source # | |
Defined in Text.Pandoc.XML.Light.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> QName -> c QName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QName # dataTypeOf :: QName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QName) # gmapT :: (forall b. Data b => b -> b) -> QName -> QName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QName -> r # gmapQ :: (forall d. Data d => d -> u) -> QName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> QName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> QName -> m QName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QName -> m QName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QName -> m QName # | |
Show QName Source # | |
Eq QName Source # | |
Ord QName Source # | |
Instances
Node Attr Source # | |
Node CData Source # | |
Node Content Source # | |
Node Element Source # | |
Node Text Source # | |
Node () Source # | |
Node [Attr] Source # | |
Node [CData] Source # | |
Node [Content] Source # | |
Node [Element] Source # | |
Node (Attr, CData) Source # | |
Node (Attr, Content) Source # | |
Node (Attr, Element) Source # | |
Node (Attr, Text) Source # | |
Node ([Attr], CData) Source # | |
Node ([Attr], Content) Source # | |
Node ([Attr], Element) Source # | |
Node ([Attr], Text) Source # | |
Node ([Attr], [CData]) Source # | |
Node ([Attr], [Content]) Source # | |
Node ([Attr], [Element]) Source # | |
Conversion functions from xml-light types
fromXLQName :: QName -> QName Source #
fromXLCData :: CData -> CData Source #
fromXLElement :: Element -> Element Source #
fromXLAttr :: Attr -> Attr Source #
fromXLContent :: Content -> Content Source #