UweSchmidt / hxt

Haskell XML Toolbox
http://www.fh-wedel.de/~si/HXmlToolbox/index.html
124 stars 35 forks source link

withCheckNamespaces chokes on xmlns:xml="http://www.w3.org/XML/1998/namespace" #63

Open vandenoever opened 7 years ago

vandenoever commented 7 years ago

XML documents should not redefine the xml prefix xml to anything but http://www.w3.org/XML/1998/namespace. Explicitly saying xmlns:xml="http://www.w3.org/XML/1998/namespace" is fine. The XHR parser option withCheckNamespaces causes the parser to fail if it explicitly declares the xml namespace prefix.

A very quick and rough workaround for this is to remove the explicit declaration:

fixXmlNs :: String -> String                                                     
fixXmlNs = unpack . replace " xmlns:xml=\"http://www.w3.org/XML/1998/namespace\"" "" . pack a