haskell-gi-0.24.0: Generate Haskell bindings for GObject Introspection capable libraries
Safe HaskellNone
LanguageHaskell2010

Data.GI.GIR.XMLUtils

Description

Some helpers for making traversals of GIR documents easier.

Synopsis

Documentation

nodeToElement :: Node -> Maybe Element Source #

Turn a node into an element (if it is indeed an element node).

subelements :: Element -> [Element] Source #

Find all children of the given element which are XML Elements themselves.

localName :: Element -> Text Source #

The local name of an element.

lookupAttr :: Name -> Element -> Maybe Text Source #

Lookup an attribute for an element (with no prefix).

data GIRXMLNamespace Source #

GIR namespaces we know about.

Constructors

GLibGIRNS 
CGIRNS 
CoreGIRNS 

Instances

Instances details
Show GIRXMLNamespace Source # 
Instance details

Defined in Data.GI.GIR.XMLUtils

Methods

showsPrec :: Int -> GIRXMLNamespace -> ShowS #

show :: GIRXMLNamespace -> String #

showList :: [GIRXMLNamespace] -> ShowS #

lookupAttrWithNamespace :: GIRXMLNamespace -> Name -> Element -> Maybe Text Source #

Lookup an attribute for an element, given the namespace where it lives.

childElemsWithLocalName :: Text -> Element -> [Element] Source #

Restrict to those with the given local name.

childElemsWithNSName :: GIRXMLNamespace -> Text -> Element -> [Element] Source #

Restrict to those with given name.

firstChildWithLocalName :: Text -> Element -> Maybe Element Source #

Find the first child element with the given name.

getElementContent :: Element -> Maybe Text Source #

Get the content of a given element, if it exists.

xmlLocalName :: Text -> Name Source #

Construct a Name by only giving the local name.

xmlNSName :: GIRXMLNamespace -> Text -> Name Source #

Construct a Name specifying a namespace too.