on master help sign in
Documentation improvements
2b585e4Neil Mitchell
src/Text/XML/Hexml.hs+3−3
@@ -78,8 +78,8 @@ touchBS = touchForeignPtr . fst3 . BS.toForeignPtr
78
78
79
79
80-- | Parse a ByteString as an XML document, returning a 'Left' error message, or a 'Right' document.
80-- | Parse a ByteString as an XML document, returning a 'Left' error message, or a 'Right' document.
81−-- Note that the returned node will have a 'name' of @\"\"@, no attributes, and content as per the document.
81+-- Note that the returned node will have a 'name' of @\"\"@, no 'attributes', and 'contents' as per the document.
82−-- Often the first child will be the @\<?xml ... ?\>@ element. For documents which comprise a single
82+-- Often the first child will be the @\<?xml ... ?\>@ element. For documents which comprise an XML node and a single
83-- root element, use @'children' n !! 1@.
83-- root element, use @'children' n !! 1@.
84parse :: BS.ByteString -> Either BS.ByteString Node
84parse :: BS.ByteString -> Either BS.ByteString Node
85parse src = do
85parse src = do
@@ -190,7 +190,7 @@ attributeBy (Node src doc n) str = unsafePerformIO $ withForeignPtr doc $ \d ->
190 touchBS src
190 touchBS src
191 return $ if r == nullPtr then Nothing else Just $ attrPeek src doc r
191 return $ if r == nullPtr then Nothing else Just $ attrPeek src doc r
192
192
193−-- | Find the starting location of a node, the '<' character.
193+-- | Find the starting location of a node, the @<@ character.
194-- The first character will be reported as @(line 1,column 1)@, because thats
194-- The first character will be reported as @(line 1,column 1)@, because thats
195-- how error messages typically do it.
195-- how error messages typically do it.
196location :: Node -> (Int, Int)
196location :: Node -> (Int, Int)