     cattrlist <- peekArray0 nullPtr cattrs
     attrlist <- mapM peekCString cattrlist
     handler name (pairwise attrlist)
+-- |Attach a StartElementHandler to a Parser.
 setStartElementHandler :: Parser -> StartElementHandler -> IO ()
 setStartElementHandler (Parser p) handler = do
   handler' <- wrapStartElementHandler handler

  h ptr cname = do
    name <- peekCString cname
    handler name
setEndElementHandler :: Parser -> EndElementHandler -> IO ()
setEndElementHandler (Parser p) handler = do
  handler' <- wrapEndElementHandler handler

  h ptr cdata len = do
    data_ <- peekCStringLen (cdata, fromIntegral len)
    handler data_
-- |Attach an CharacterDataHandler to a Parser.
setCharacterDataHandler :: Parser -> CharacterDataHandler -> IO ()
setCharacterDataHandler (Parser p) handler = do
  handler' <- wrapCharacterDataHandler handler
