X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FXml.hs;h=c4d4049e2f5ec4fc62d93d80ab31d83e8d07c764;hb=53c5550fee7f8a39a7906545978f15876a06fbd1;hp=2f68dd09c661de44048f78fe0a45314fe4d38b98;hpb=10e7a7d5c354cdaa47d479f785a76eb6bf49e535;p=dead%2Fhtsn-import.git diff --git a/src/Xml.hs b/src/Xml.hs index 2f68dd0..c4d4049 100644 --- a/src/Xml.hs +++ b/src/Xml.hs @@ -19,13 +19,9 @@ import Text.XML.HXT.Core ( SysConfigList, XmlPickler(..), hasName, - no, readDocument, runX, - withPreserveComment, withRemoveWS, - withSubstDTDEntities, - withValidate, xpickleVal, xunpickleVal, yes ) @@ -69,18 +65,11 @@ class ToFromXml a where newtype DtdName = DtdName String -- | A list of options passed to 'readDocument' when we parse an XML --- document. We don't validate because the DTDs from TSN are --- wrong. As a result, we don't want to keep useless DTDs --- areound. Thus we disable 'withSubstDTDEntities' which, when --- combined with "withValidate no", prevents HXT from trying to read --- the DTD at all. +-- document. All cosmetic whitespace should be removed, otherwise we +-- have to parse it in each pickler. -- parse_opts :: SysConfigList -parse_opts = - [ withPreserveComment no, - withRemoveWS yes, - withSubstDTDEntities no, - withValidate no ] +parse_opts = [ withRemoveWS yes ] -- | Given a root element name and a file path, return both the @@ -106,7 +95,7 @@ pickle_unpickle :: XmlPickler a pickle_unpickle root_element filepath = do -- We need to check only the root message element since -- readDocument produces a bunch of other junk. - expected <- runX $ arr_getobj + expected <- runX arr_getobj actual <- runX $ arr_getobj >>> xpickleVal xpickle