on master help sign in
Add selectors to Attribute
b4b0036Neil Mitchell
src/Text/XML/Hexml.hs+4−1
@@ -64,7 +64,10 @@ data Node = Node BS.ByteString (ForeignPtr CDocument) (Ptr CNode)
64
64
65-- | An XML attribute, comprising of a name and a value. As an example,
65-- | An XML attribute, comprising of a name and a value. As an example,
66-- @hello=\"world\"@ would produce @Attribute \"hello\" \"world\"@.
66-- @hello=\"world\"@ would produce @Attribute \"hello\" \"world\"@.
67−data Attribute = Attribute BS.ByteString BS.ByteString deriving (Show, Eq, Ord)
67+data Attribute = Attribute
68+ {attributeName :: BS.ByteString
69+ ,attributeVaule :: BS.ByteString
70+ } deriving (Show, Eq, Ord)
68
71
69instance Show Node where
72instance Show Node where
70 show d = "Node " ++ show (BS.unpack $ outer d)
73 show d = "Node " ++ show (BS.unpack $ outer d)