Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.GI.GIR.XMLUtils
Description
Some helpers for making traversals of GIR documents easier.
- nodeToElement :: Node -> Maybe Element
- subelements :: Element -> [Element]
- localName :: Element -> Text
- lookupAttr :: Name -> Element -> Maybe Text
- data GIRXMLNamespace
- lookupAttrWithNamespace :: GIRXMLNamespace -> Name -> Element -> Maybe Text
- childElemsWithLocalName :: Text -> Element -> [Element]
- childElemsWithNSName :: GIRXMLNamespace -> Text -> Element -> [Element]
- firstChildWithLocalName :: Text -> Element -> Maybe Element
- getElementContent :: Element -> Maybe Text
- xmlLocalName :: Text -> Name
- xmlNSName :: GIRXMLNamespace -> Text -> Name
Documentation
nodeToElement :: Node -> Maybe Element #
Turn a node into an element (if it is indeed an element node).
subelements :: Element -> [Element] #
Find all children of the given element which are XML Elements themselves.
lookupAttrWithNamespace :: GIRXMLNamespace -> Name -> Element -> Maybe Text #
Lookup an attribute for an element, given the namespace where it lives.
childElemsWithLocalName :: Text -> Element -> [Element] #
Restrict to those with the given local name.
childElemsWithNSName :: GIRXMLNamespace -> Text -> Element -> [Element] #
Restrict to those with given name.
firstChildWithLocalName :: Text -> Element -> Maybe Element #
Find the first child element with the given name.
getElementContent :: Element -> Maybe Text #
Get the content of a given element, if it exists.
xmlLocalName :: Text -> Name #
Construct a Name
by only giving the local name.