From 40ab1bcc0f1517ac9910928dd658c09195f50f12 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 10 Jan 2014 16:53:12 -0500 Subject: [PATCH] Simplify parse_opts now that we can validate against the DTDs. --- src/Xml.hs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Xml.hs b/src/Xml.hs index 7f641b2..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,17 +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 ] +parse_opts = [ withRemoveWS yes ] -- | Given a root element name and a file path, return both the -- 2.43.2