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

CopyrightCopyright (C) 2008 Uwe Schmidt
LicenseMIT
MaintainerUwe Schmidt (uwe@fh-wedel.de)
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Text.XML.HXT.DOM.Util

Description

Little useful things for strings, lists and other values

Synopsis

Documentation

stringTrim :: String -> String Source #

remove leading and trailing whitespace with standard Haskell predicate isSpace

stringToLower :: String -> String Source #

convert string to lowercase with standard Haskell toLower function

stringToUpper :: String -> String Source #

convert string to uppercase with standard Haskell toUpper function

stringAll :: Eq a => [a] -> [a] -> [Int] Source #

find all positions where a string occurs within another string

stringFirst :: Eq a => [a] -> [a] -> Maybe Int Source #

find the position of the first occurence of a string

stringLast :: Eq a => [a] -> [a] -> Maybe Int Source #

find the position of the last occurence of a string

normalizeNumber :: String -> String Source #

Removes leading / trailing whitespaces and leading zeros

normalizeWhitespace :: String -> String Source #

Reduce whitespace sequences to a single whitespace

normalizeBlanks :: String -> String Source #

replace all whitespace chars by blanks

escapeURI :: String -> String Source #

Escape all disallowed characters in URI references (see http://www.w3.org/TR/xlink/#link-locators)

textEscapeXml :: String -> String Source #

escape XML chars < and ampercent by transforming them into character references, used for escaping text nodes

see also : attrEscapeXml

stringEscapeXml :: String -> String Source #

escape XML chars <, >, ", and ampercent by transforming them into character references

see also : attrEscapeXml

attrEscapeXml :: String -> String Source #

escape XML chars in attribute values, same as stringEscapeXml, but none blank whitespace is also escaped

see also : stringEscapeXml

stringToHexString :: String -> String Source #

convert a string into a hexadecimal string applying charToHexString

see also : charToHexString

charToHexString :: Char -> String Source #

convert a char (byte) into a 2-digit hexadecimal string

see also : stringToHexString, intToHexString

intToHexString :: Int -> String Source #

convert a none negative Int into a hexadecimal string

see also : charToHexString

hexStringToInt :: String -> Int Source #

convert a string of hexadecimal digits into an Int

decimalStringToInt :: String -> Int Source #

convert a string of digits into an Int

doubles :: Eq a => [a] -> [a] Source #

take all elements of a list which occur more than once. The result does not contain doubles. (doubles . doubles == doubles)

singles :: Eq a => [a] -> [a] Source #

drop all elements from a list which occur more than once.

noDoubles :: Eq a => [a] -> [a] Source #

remove duplicates from list

swap :: (a, b) -> (b, a) Source #

partitionEither :: [Either a b] -> ([a], [b]) Source #

toMaybe :: Bool -> a -> Maybe a Source #

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

mothers little helpers for to much curry

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source #