xml-lens-0.1.6.3: Lenses, traversals, and prisms for xml-conduit

Copyright(C) 2015 Fumiaki Kinoshita
LicenseBSD-style (see the file LICENSE)
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Text.XML.Lens

Contents

Description

 

Synopsis

Lenses, traversals for Element

data Element :: *

Instances

Eq Element 
Data Element 
Ord Element 
Show Element 
ToMarkup Element

Note that the special element name {http:/www.snoyman.comxml2html}ie-cond with the single attribute cond is used to indicate an IE conditional comment.

NFData Element 
Plated Element

plate traverses over its sub-elements.

Typeable * Element 

(./) :: (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

Combine two Traversals just like XPath's slash. Identical to (...).

l ./ m ≡ l . plate . m

Names

el :: Name -> Traversal' Element Element Source

Traverse elements which has the specified name.

named :: CI Text -> Traversal' Element Element Source

Traverse elements which has the specified *local* name (case-insensitive).

Attributes

Contents

text :: Traversal' Element Text Source

Traverse all contents of the element.

comment :: Traversal' Element Text Source

Traverse all comments of the element.

Children

entire :: Traversal' Element Element Source

Traverse itself with its all children. Rewriting subnodes of each children will break a traversal law.

Prisms for Node

class AsInstruction t where Source

Minimal complete definition

Nothing

class AsComment t where Source

Minimal complete definition

Nothing

Lenses for Document

root :: Lens' Document Element Source

The root element of the document.

Lenses for Name

data 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"

Lenses for Instruction

Reexport