packages feed

HaXml 1.25.8 → 1.25.9

raw patch · 9 files changed

+146/−22 lines, 9 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

Changelog.md view
@@ -1,3 +1,8 @@+## 1.25.9 (2022-04-10)+- fix 1.25.7 regression in Xtract.Parse (#7 by Isaac van Bakel)+- comment typo fixes (#6 by Eric Lindblad)+- include README file+ ## 1.25.8 (2021-11-22) - version the License tag in HaXml.cabal as LGPL-2.1 (#3) - allow building with ghc 9.2 (#4)
HaXml.cabal view
@@ -1,6 +1,6 @@-cabal-version:  >= 1.10+cabal-version:  1.18 name:           HaXml-version:        1.25.8+version:        1.25.9  license:        LGPL-2.1 license-files:  COPYRIGHT, LICENCE-GPL, LICENCE-LGPL@@ -14,7 +14,7 @@         Haskell utilities for parsing, filtering, transforming and         generating XML documents. build-type:     Simple-extra-source-files: Changelog.md+extra-doc-files: Changelog.md README  tested-with:   GHC ==9.2.1@@ -99,6 +99,8 @@   default-language: Haskell98   default-extensions: CPP, ExistentialQuantification   nhc98-options: -K10M+  if impl(ghc >= 8.2)+    ghc-options:       -fhide-source-paths  Executable Canonicalise   GHC-Options: -Wall
+ README view
@@ -0,0 +1,117 @@+        HaXml - Haskell utilities for processing XML+        --------------------------------------------++Installation instructions:+We currently support nhc98, ghc, and Hugs.  The automatic configuration+detects which compilers/interpreters you have, and prepares a build+tree for each.  Installation requires write-permission on the system+directories of the compiler/interpreter - the libraries and interfaces+can then be used as "-package HaXml" (for ghc/nhc98 - no extra options+required for Hugs).  The standalone tools are installed to a directory of+your choice.++For newer compilers, use Cabal to build and install:++    cabal install++or ++    runhaskell Setup.hs configure+    runhaskell Setup.hs build+    runhaskell Setup.hs install++For older compilers, use the traditional sequence:++    ./configure+    make+    make install++Options to configure are:+    --buildwith=...  e.g. ghc-6.2,        to build for a specific compiler+    --prefix=...     e.g. /usr/local/bin, installation location for HaXml tools++Complaints to:  :-)+    Malcolm.Wallace@me.com++P.S.+    For those building on Windows /without/ Cygwin, you can avoid the need+    for configure/make steps by simply running the minimal build script in+        Build.bat+    You will need to edit it for the location of your compiler etc.++----+What this package contains:++  docs/			Some rudimentary HTML documentation about the libraries.+  docs/HaXml/		Haddock-generated API documentation.+  examples/		Some small examples of how the libraries/tools are used.++  src/Text/XML/HaXml/	Numerous support modules for processing XML.+			(The main APIs are as follows:)+	Types.hs	Defines a (generic) representation for any XML document.+	Parse.hs	Parses an XML document into the generic representation.+	ParseLazy.hs	A more space-efficient parser.+	Pretty.hs	Pretty-prints an XML document.+	Validate.hs	Validates an XML document against a DTD.+	Combinators.hs	Provides the combinators described in the ICFP'99 paper+			together with some other useful functions.+	SAX.hs		A simple SAX-like stream-event-parser.+	Wrappers.hs	Simple top-level wrappers for processing a single+			document using the combinators.+	XmlContent.hs	A replacement class for Show/Read, to translate Haskell+			values to/from XML documents.  Can be derived by DrIFT+			and/or DtdToHaskell.+	TypeMapping.hs	Defines an explicit representation for Haskell types,+			allowing generation of a DTD from a Haskell value.+	OneOfN.hs	Some support types (OneOf2 - OneOf20) for code+			generated by tools/DtdToHaskell.++  src/Text/XML/HaXml/Html	Extra support modules for processing HTML.+	Parse.hs	An error-correcting HTML parser, produces the generic+			XML representation.+	Pretty.hs	An HTML-specific pretty-printer.+	Generate.hs	Some useful combinators for generating HTML content.++  src/Text/XML/HaXml/Schema	Extra support modules for processing Schema.+	XSDTypeModel.hs		A representation of the datatype model of+				Xml Schema in terms of XSD concepts.+	HaskellTypeModel.hs	A representation of the datatype model of+				Xml Schema in terms of Haskell datatypes.+	Parse.hs		Parser from an XSD document to the XSD+				type model above.+	TypeConversion.hs	Translate from the XSD model to the Haskell+				model.+	PrettyHaskell.hs	Generate Haskell sourcecode from the Haskell+				type model.++  src/tools/		Standalone tools based on the library above.+	DtdToHaskell	Translates an XML doc containing a DTD into a Haskell+			module containing data/newtype definitions.+	Xtract		A structured 'grep' for XML docs, loosely based on+			the XPath and XQL query languages.+	Validate	A simple validation tool for XML docs.  Give it a DTD+			file and an XML file, and it reports all validation+			errors it can find.+	Canonicalise	A 'cat' filter for XML docs, shows our "standard"+			parsing and pretty-printing behaviour.+	MkOneOf		Generates a OneOfN type, given an N, together with+			its required instance of XmlContent.  Sometimes types+			larger than OneOf20 are required in code generated by+			DtdToHaskell.+	XsdToHaskell	Translates an XSD schema into a Haskell module.+	FpMLToHaskell	Translates the set of XSD schemas defining the FpML+			language into a set of Haskell modules.++  src/Text/XML/HaXml/Xtract	Internal APIs of the Xtract tool.+	Parse.hs	Parse an XPath query to produce a filter.+	Combinators.hs	Modified version of the standard combinators.++  src/Text/XML/HaXml/DtdToHaskell	Internal APIs of the DtdToHaskell tool.+	TypeDef.hs	A representation of the Haskell types corresponding+			to an XML DTD, and a pretty printer for them.+	Convert.hs	Convert the standard DTD representation to the+			Haskell-like TypeDef representation.+	Instance.hs	Generate appropriate XmlContent class instances for+			the TypeDefs.++----
src/Text/XML/HaXml/Combinators.hs view
@@ -187,7 +187,7 @@ union = lift (++)               -- in Haskell 98:   union = lift List.union   where     lift :: (a->b->d) -> (c->a) -> (c->b) -> c -> d-    lift f g h = \x-> f (g x) (h x)+    lift f g h x = f (g x) (h x)  -- | Glue a list of filters together.  (A list version of union; --   also has a more general type than just CFilter.)
src/Text/XML/HaXml/Schema/Parse.hs view
@@ -646,12 +646,12 @@ -- | Parse an attribute value that should be a QName. qname :: (String->String->QName) -> TextParser QName qname q = do a <- word-             (do ":" <- word-                 b   <- many (satisfy (/=':'))-                 return (q a b)+             do ":" <- word+                b   <- many (satisfy (/=':'))+                return (q a b)                `onFail`-               do cs <- many next-                  return (N (a++cs)))+                 do cs <- many next+                    return (N (a++cs))  -- | Parse an attribute value that should be a simple Name. name :: TextParser Name
src/Text/XML/HaXml/Xtract/Combinators.hs view
@@ -58,7 +58,7 @@ union :: (a->b->[c]) -> (a->b->[c]) -> (a->b->[c]) union = lift (++)   where-    lift f g h = \x y-> f (g x y) (h x y)+    lift f g h x y = f (g x y) (h x y)  -- | lifted predicates. with, without :: DFilter i -> DFilter i -> DFilter i
src/Text/XML/HaXml/Xtract/Parse.hs view
@@ -253,8 +253,8 @@          do symbol "@"             attr <- string             return (D.iffind attr (local . C.literal) D.none `D.o` q1)-         `onFail`-         tquery ((q1 D./>):cxt)+           `onFail`+           tquery ((q1 D./>):cxt)     , do symbol "//"          tquery ((\q2-> liftLocal C.multi q2                             `D.o` local C.children `D.o` q1):cxt)
src/tools/DtdToHaskell.hs view
@@ -22,7 +22,7 @@ import Text.XML.HaXml.DtdToHaskell.Instance (mkInstance) import Text.PrettyPrint.HughesPJ (render,vcat) --- sucked in from Text.XML.HaXml.Wrappers to avod dependency on T.X.H.Html+-- sucked in from Text.XML.HaXml.Wrappers to avoid dependency on T.X.H.Html fix2Args :: IO (String,String) fix2Args = do   args <- getArgs
src/tools/Xtract.hs view
@@ -3,7 +3,7 @@ ------------------------------------------------------------ module Main where import System.Environment (getArgs)-import System.Exit        (exitWith, ExitCode(..))+import System.Exit        (exitWith, exitSuccess, ExitCode(..)) import System.IO import Data.Char          (toLower) import Data.List          (isSuffixOf)@@ -53,10 +53,10 @@   let opts = foldl (flip ($)) defaultOptions preOpts   when (printVersion opts) $ do       putStrLn $ "part of HaXml-"++version-      exitWith ExitSuccess+      exitSuccess   when (printHelp opts) $ do-      putStrLn $ "See http://haskell.org/HaXml"-      exitWith ExitSuccess+      putStrLn "See http://haskell.org/HaXml"+      exitSuccess   when (length args < 1) $ do       putStrLn $ usageInfo "Usage: Xtract [options] <pattern> [xmlfile ...]" options       exitWith (ExitFailure 1)@@ -64,7 +64,7 @@         (Text.XML.HaXml.ParseLazy.xmlParse, Text.XML.HaXml.Html.ParseLazy.htmlParse)         else         (Text.XML.HaXml.Parse.xmlParse, Text.XML.HaXml.Html.Parse.htmlParse)-  let (pattern,files,esc) =+  let (pat,files,esc) =           (head args,tail args,if doEscaping opts then escape .(:[]) else (:[])) --      findcontents = --        if null files then (getContents >>= \x-> return [xmlParse "<stdin>"x])@@ -77,11 +77,11 @@ --  . map (vcat . map content . selection . docContent)) cs   mapM_ (\x->   do c <- (if x=="-" then getContents else readFile x)                    ( if isHTML x || forceHtml opts then-                          hPutStrLn stdout . render . htmlprint-                          . xtract (map toLower) pattern+                          putStrLn . render . htmlprint+                          . xtract (map toLower) pat                           . docContent (posInNewCxt x Nothing) . htmlParse x-                     else hPutStrLn stdout . render . vcat . map (format . esc)-                          . xtract id pattern+                     else putStrLn . render . vcat . map (format . esc)+                          . xtract id pat                           . docContent (posInNewCxt x Nothing) . xmlParse x) c                    hFlush stdout)           files