multifocal-0.0.1: src/Language/XPath/HXTAliases.hs
-----------------------------------------------------------------------------
-- |
-- Module : Language.XPath.HXTAliases
-- Copyright : (c) 2011 University of Minho
-- License : BSD3
--
-- Maintainer : hpacheco@di.uminho.pt
-- Stability : experimental
-- Portability : non-portable
--
-- Multifocal:
-- Bidirectional Two-level Transformation of XML Schemas
--
-- Aliases for HXT library.
--
-----------------------------------------------------------------------------
module Language.XPath.HXTAliases where
import qualified Text.XML.HXT.XPath as HXT
import Text.XML.HXT.XPath.XPathDataTypes
import Text.XML.HXT.Parser.XmlCharParser( withNormNewline )
import Text.ParserCombinators.Parsec ( runParser )
import Text.XML.HXT.XPath.XPathToString
import Text.XML.HXT.DOM.QualifiedName
type XPath = Expr
parseXPath :: String -> Maybe XPath
parseXPath path = case runParser HXT.parseXPath (withNormNewline []) "" path of
Left err -> Nothing
Right xp -> Just xp