[Haskell-cafe] HaXml: ampersand in attribute value
Graham Klyne
GK at ninebynine.org
Mon Feb 20 11:30:13 EST 2006
Lennart Augustsson wrote:
> But speaking of HaXml bugs, I'm pretty sure HaXml doesn't handle
> % correctly. It seem to treat % specially everywhere, but I think
> it is only special inside DTDs. I have many XML files produced by
> other tools that the HaXml parser fails to process because of this.
Indeed. This is an area that I found required a fair amount of work on the
version of HaXML I was playing with, some time ago.
The change log at the end of:
http://www.ninebynine.org/Software/HaskellUtils/HaXml-1.12/src/Text/XML/HaXml/Lex.hs
has some clues to what I had to do. Notably:
[[
-- Revision 1.12 2004/06/04 21:59:13 graham
-- Wortk-in-progress: creating intermediate filter to handle parameter
-- entity replacement. Separated common features from parse module.
-- Created new module based on simplified use of parsing utilities
-- to dtect and substitute PEs. The result is a modifed token sequence
-- passed to the main XML parser.
]]
The parameter entity filter is defined by:
http://www.ninebynine.org/Software/HaskellUtils/HaXml-1.12/src/Text/XML/HaXml/SubstitutePE.hs
The parameter and entity entity handling aspect of the code was not pretty, due
mainly to the somewhat quirky nature of XML syntax, especially concerning
parameter and general entities.
#g
--
Graham Klyne
For email:
http://www.ninebynine.org/#Contact
More information about the Haskell-Cafe
mailing list