Hets - the Heterogeneous Tool Set
Copyright(c) Christian Maeder DFKI GmbH 2010
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellNone

Common.XUpdate

Description

Synopsis

Documentation

data AddChange Source #

possible insertions

Constructors

AddElem Element 
AddAttr Attr 
AddText String 
AddComment String 
AddPI String String 
ValueOf 

Instances

Instances details
Show AddChange Source # 
Instance details

Defined in Common.XUpdate

Methods

showsPrec :: Int -> AddChange -> ShowS

show :: AddChange -> String

showList :: [AddChange] -> ShowS

valueOfS :: String Source #

data Insert Source #

Constructors

Before 
After 
Append 

Instances

Instances details
Eq Insert Source # 
Instance details

Defined in Common.XUpdate

Methods

(==) :: Insert -> Insert -> Bool

(/=) :: Insert -> Insert -> Bool

Show Insert Source # 
Instance details

Defined in Common.XUpdate

Methods

showsPrec :: Int -> Insert -> ShowS

show :: Insert -> String

showList :: [Insert] -> ShowS

showInsert :: Insert -> String Source #

data ChangeSel Source #

Constructors

Add Insert [AddChange] 
Remove 
Update String 
Rename String 
Variable String 

Instances

Instances details
Show ChangeSel Source # 
Instance details

Defined in Common.XUpdate

Methods

showsPrec :: Int -> ChangeSel -> ShowS

show :: ChangeSel -> String

showList :: [ChangeSel] -> ShowS

data Change Source #

Constructors

Change ChangeSel Expr 

Instances

Instances details
Show Change Source # 
Instance details

Defined in Common.XUpdate

Methods

showsPrec :: Int -> Change -> ShowS

show :: Change -> String

showList :: [Change] -> ShowS

anaXUpdates :: MonadFail m => String -> m [Change] Source #

anaMods :: MonadFail m => Element -> m [Change] Source #

xupdateS :: String Source #

updateS :: String Source #

elementS :: String Source #

attributeS :: String Source #

textS :: String Source #

appendS :: String Source #

removeS :: String Source #

selectS :: String Source #

isXUpdateQN :: QName -> Bool Source #

hasLocalQN :: String -> QName -> Bool Source #

isElementQN :: QName -> Bool Source #

isAttributeQN :: QName -> Bool Source #

isTextQN :: QName -> Bool Source #

isAddQN :: QName -> Bool Source #

isRemoveQN :: QName -> Bool Source #

getAttrVal :: MonadFail m => String -> Element -> m String Source #

extract the non-empty attribute value

readAttrVal :: (Read a, MonadFail m) => String -> String -> Element -> m a Source #

apply a read operation to the extracted value

maybeF :: MonadFail m => String -> Maybe a -> m a Source #

getSelectAttr :: MonadFail m => Element -> m String Source #

getNameAttr :: MonadFail m => Element -> m String Source #

str2QName :: String -> QName Source #

convert a string to a qualified name by splitting at the colon

getText :: MonadFail m => Element -> m String Source #

extract text and check for no other children

getXUpdateText :: MonadFail m => Element -> m String Source #

anaXUpdate :: MonadFail m => Element -> m Change Source #

partitionAddChanges :: [AddChange] -> ([Attr], [Content]) Source #

partitions additions and ignores comments, pi, and value-of

failX :: MonadFail m => String -> QName -> m a Source #

noContent :: MonadFail m => Element -> a -> m a Source #

check if the element contains no other content

addXElem :: MonadFail m => Element -> m AddChange Source #

emptyCData :: CData -> Bool Source #

validContent :: Content -> Bool Source #

cleanUpElem :: Element -> Element Source #