Copyright | (C) 2015 Fumiaki Kinoshita |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Element = Element {
- elementName :: Name
- elementAttributes :: Map Name Text
- elementNodes :: [Node]
- (./) :: (Applicative f, Plated c) => LensLike f s t c c -> Over p f c c a b -> Over p f s t a b
- (...) :: (Applicative f, Plated c) => LensLike f s t c c -> Over p f c c a b -> Over p f s t a b
- name :: Lens' Element Name
- localName :: Lens' Element Text
- el :: Name -> Traversal' Element Element
- ell :: Text -> Traversal' Element Element
- named :: CI Text -> Traversal' Element Element
- attributeIs :: Name -> Text -> Traversal' Element Element
- attributeSatisfies :: Name -> (Text -> Bool) -> Traversal' Element Element
- attr :: Name -> Traversal' Element Text
- attribute :: Name -> Lens' Element (Maybe Text)
- attrs :: Lens' Element (Map Name Text)
- text :: Traversal' Element Text
- comment :: Traversal' Element Text
- entire :: Traversal' Element Element
- nodes :: Lens' Element [Node]
- data Node
- _Element :: Prism' Node Element
- _Content :: Prism' Node Text
- class AsInstruction t where
- class AsComment t where
- data Document = Document {}
- root :: Lens' Document Element
- prologue :: Lens' Document Prologue
- epilogue :: Lens' Document [Miscellaneous]
- doctype :: Lens' Prologue (Maybe Doctype)
- data Name = Name {}
- _nameLocalName :: Lens' Name Text
- _nameNamespace :: Lens' Name (Maybe Text)
- _namePrefix :: Lens' Name (Maybe Text)
- data Instruction = Instruction {}
- _instructionTarget :: Lens' Instruction Text
- _instructionData :: Lens' Instruction Text
Lenses, traversals for Element
Element | |
|
Instances
Eq Element | |
Data Element | |
Defined in Text.XML 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 :: (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 # | |
Ord Element | |
Show Element | |
ToMarkup Element | Note that the special element name
|
NFData Element | |
Plated Element Source # |
|
Defined in Text.XML.Lens |
(./) :: (Applicative f, Plated c) => LensLike f s t c c -> Over p f c c a b -> Over p f s t a b infixr 9 Source #
(...) :: (Applicative f, Plated c) => LensLike f s t c c -> Over p f c c a b -> Over p f s t a b infixr 9 #
Compose through a plate
Names
named :: CI Text -> Traversal' Element Element Source #
Traverse elements which has the specified *local* name (case-insensitive).
Attributes
attributeIs :: Name -> Text -> Traversal' Element Element Source #
attributeSatisfies :: Name -> (Text -> Bool) -> Traversal' Element Element Source #
Contents
Children
entire :: Traversal' Element Element Source #
Deprecated: Use cosmos or deep instead
Traverse itself with its all children. Rewriting subnodes of each children will break a traversal law.
Prisms for Node
Instances
Eq Node | |
Data Node | |
Defined in Text.XML gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Node -> c Node # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Node # dataTypeOf :: Node -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Node) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node) # gmapT :: (forall b. Data b => b -> b) -> Node -> Node # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r # gmapQ :: (forall d. Data d => d -> u) -> Node -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Node -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Node -> m Node # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Node -> m Node # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Node -> m Node # | |
Ord Node | |
Show Node | |
ToMarkup Node | |
NFData Node | |
AsComment Node Source # | |
AsInstruction Node Source # | |
Defined in Text.XML.Lens |
class AsInstruction t where Source #
_Instruction :: Prism' t Instruction Source #
Instances
AsInstruction Node Source # | |
Defined in Text.XML.Lens | |
AsInstruction Miscellaneous Source # | |
Defined in Text.XML.Lens |
Lenses for Document
Instances
Eq Document | |
Data Document | |
Defined in Text.XML gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Document -> c Document # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Document # toConstr :: Document -> Constr # dataTypeOf :: Document -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Document) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document) # gmapT :: (forall b. Data b => b -> b) -> Document -> Document # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Document -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Document -> r # gmapQ :: (forall d. Data d => d -> u) -> Document -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Document -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Document -> m Document # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Document -> m Document # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Document -> m Document # | |
Show Document | |
ToMarkup Document | |
NFData Document | |
Lenses for Name
A fully qualified name.
Prefixes are not semantically important; they are included only to
simplify pass-through parsing. When comparing names with Eq
or Ord
methods, prefixes are ignored.
The IsString
instance supports Clark notation; see
http://www.jclark.com/xml/xmlns.htm and
http://infohost.nmt.edu/tcc/help/pubs/pylxml/etree-QName.html. Use
the OverloadedStrings
language extension for very simple Name
construction:
myname :: Name myname = "{http://example.com/ns/my-namespace}my-name"
Name | |
|
Instances
Eq Name | |
Data Name | |
Defined in Data.XML.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # | |
Ord Name | |
Show Name | |
IsString Name | |
Defined in Data.XML.Types fromString :: String -> Name # | |
Generic Name | |
NFData Name | |
Defined in Data.XML.Types | |
type Rep Name | |
Defined in Data.XML.Types type Rep Name = D1 (MetaData "Name" "Data.XML.Types" "xml-types-0.3.6-56MQ2lbfiw31ognZ51DOah" False) (C1 (MetaCons "Name" PrefixI True) (S1 (MetaSel (Just "nameLocalName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: (S1 (MetaSel (Just "nameNamespace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "namePrefix") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))))) |
Lenses for Instruction
data Instruction #