hxt-8.4.1: A collection of tools for processing XML with Haskell.

Portabilityportable
Stabilityexperimental
MaintainerUwe Schmidt (uwe@fh-wedel.de)

Text.XML.HXT.Arrow.XPathSimple

Description

XPath selection for simple XPath expressions with list arrows instead of navigable trees.

It is recommended, that this module is imported qualified, e.g like Text.XML.HXT.Arrow.XPathSimple as XS.

The arrows defined in this module have the same functionality as the functions in Text.XML.HXT.Arrow.XPath.

The computation model in XPath is a navigable tree, that means a tree which can be traversed in arbitrary directions, not only from the root to the leafs. Sometimes this model leads to inefficient XPath processing for simple queries, which only need a top down tree traversal.

When evaluating an XPath expression with these functions, first an attempt is made to map the XPath expression to a pure arrow. If this is possible due to the simplicity of the XPath expressions, the result is computed directly, else the query is processed by the corresponding function in Text.XML.HXT.Arrow.XPath.

The simple evaluation is possible, when in the XPath expression only the top down axes (self, child, descendant, descendant or self) are used, when no built-in functions concerning the position of a node are used, and no comparison of nodes e.g. in node set union is required.

Synopsis

Documentation

getXPathTreesInDoc :: ArrowXml a => String -> a XmlTree XmlTreeSource

Same Functionality as Text.XML.HXT.Arrow.XPath.getXPathTreesInDoc

getXPathTreesInDocWithNsEnv :: ArrowXml a => Attributes -> String -> a XmlTree XmlTreeSource

Same Functionality as Text.XML.HXT.Arrow.XPath.getXPathTreesInDocWithNsEnv

getXPathTrees :: ArrowXml a => String -> a XmlTree XmlTreeSource

Same Functionality as Text.XML.HXT.Arrow.XPath.getXPathTrees

getXPathTreesWithNsEnv :: ArrowXml a => Attributes -> String -> a XmlTree XmlTreeSource

Same Functionality as Text.XML.HXT.Arrow.XPath.getXPathTreesWithNsEnv

getXPathTreesWithNsEnvSimple :: ArrowXml a => Attributes -> String -> a XmlTree XmlTreeSource

The xpath interpreter for simple xpath expressions.

In case of a too complicated or illegal xpath expression an error node is returned, else the list of selected XML trees

type XPArrow b c = Maybe (LA b c)Source

mk :: LA b c -> XPArrow b cSource

unwrap :: XPArrow b b -> LA b bSource

(>>>>) :: XPArrow b b -> XPArrow b b -> XPArrow b bSource

(&&&&) :: XPArrow b b -> XPArrow b b -> XPArrow b (b, b)Source

(<+>>) :: XPArrow b b -> XPArrow b b -> XPArrow b bSource

guards' :: XPArrow b b -> XPArrow b b -> XPArrow b bSource

xIndex :: Int -> LA [b] bSource

equalNodeSet :: Eq a => [a] -> [a] -> [a]Source