doc: Update htmlxref.cnf.
[guix.git] / gnu / packages / xml.scm
blob6ae9cd65d5006291fb707e69d29b9bd5cf257d22
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
6 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
8 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2015 Raimon Grau <raimonster@gmail.com>
10 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
13 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
14 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
15 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
16 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
17 ;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
18 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
19 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
20 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
21 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
22 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
23 ;;;
24 ;;; This file is part of GNU Guix.
25 ;;;
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
30 ;;;
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
34 ;;; GNU General Public License for more details.
35 ;;;
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
39 (define-module (gnu packages xml)
40   #:use-module (gnu packages)
41   #:use-module (gnu packages autotools)
42   #:use-module (gnu packages check)
43   #:use-module (gnu packages compression)
44   #:use-module (gnu packages curl)
45   #:use-module (gnu packages gnupg)
46   #:use-module (gnu packages java)
47   #:use-module (gnu packages nss)
48   #:use-module (gnu packages perl)
49   #:use-module (gnu packages perl-check)
50   #:use-module (gnu packages python)
51   #:use-module (gnu packages tls)
52   #:use-module (gnu packages web)
53   #:use-module ((guix licenses) #:prefix license:)
54   #:use-module (guix packages)
55   #:use-module (guix download)
56   #:use-module (guix git-download)
57   #:use-module (guix build-system ant)
58   #:use-module (guix build-system cmake)
59   #:use-module (guix build-system gnu)
60   #:use-module (guix build-system perl)
61   #:use-module (guix build-system python)
62   #:use-module (gnu packages linux)
63   #:use-module (gnu packages pkg-config))
65 (define-public expat
66   (package
67     (name "expat")
68     (version "2.2.6")
69     (source (origin
70              (method url-fetch)
71              (uri (string-append "mirror://sourceforge/expat/expat/"
72                                  version "/expat-" version ".tar.bz2"))
73              (sha256
74               (base32
75                "1wl1x93b5w457ddsdgj0lh7yjq4q6l7wfbgwhagkc8fm2qkkrd0p"))))
76     (build-system gnu-build-system)
77     (home-page "https://libexpat.github.io/")
78     (synopsis "Stream-oriented XML parser library written in C")
79     (description
80      "Expat is an XML parser library written in C.  It is a
81 stream-oriented parser in which an application registers handlers for
82 things the parser might find in the XML document (like start tags).")
83     (license license:expat)))
85 (define-public libebml
86   (package
87     (name "libebml")
88     (version "1.3.7")
89     (source
90      (origin
91        (method url-fetch)
92        (uri (string-append "https://dl.matroska.org/downloads/libebml/"
93                            "libebml-" version ".tar.xz"))
94        (sha256
95         (base32 "1x79b35dj5d2x7xf7ql83w2cr0v5n2vsd08q6y6grmw4yn3lq973"))))
96     (build-system cmake-build-system)
97     (arguments
98      `(#:configure-flags
99        (list "-DBUILD_SHARED_LIBS=YES")
100        #:tests? #f))                    ; no test suite
101     (home-page "https://matroska-org.github.io/libebml/")
102     (synopsis "C++ library to parse EBML files")
103     (description "libebml is a C++ library to read and write @dfn{EBML}
104 (Extensible Binary Meta Language) files.  EBML was designed to be a simplified
105 binary extension of XML for the purpose of storing and manipulating data in a
106 hierarchical form with variable field lengths.")
107     (license license:lgpl2.1)))
109 (define-public libxml2
110   (package
111     (name "libxml2")
112     (version "2.9.8")
113     (source (origin
114              (method url-fetch)
115              (uri (string-append "ftp://xmlsoft.org/libxml2/libxml2-"
116                                  version ".tar.gz"))
117              (sha256
118               (base32
119                "0ci7is75bwqqw2p32vxvrk6ds51ik7qgx73m920rakv5jlayax0b"))))
120     (build-system gnu-build-system)
121     (outputs '("out" "static"))
122     (arguments
123      `(#:phases (modify-phases %standard-phases
124                   (add-after 'install 'move-static-libs
125                     (lambda* (#:key outputs #:allow-other-keys)
126                       (let ((src (string-append (assoc-ref outputs "out") "/lib"))
127                             (dst (string-append (assoc-ref outputs "static")
128                                                 "/lib")))
129                         (mkdir-p dst)
130                         (for-each (lambda (ar)
131                                     (rename-file ar (string-append dst "/"
132                                                                    (basename ar))))
133                                   (find-files src "\\.a$"))
134                         #t))))))
135     (home-page "http://www.xmlsoft.org/")
136     (synopsis "C parser for XML")
137     (inputs `(("xz" ,xz)))
138     (propagated-inputs `(("zlib" ,zlib))) ; libxml2.la says '-lz'.
139     (native-inputs `(("perl" ,perl)))
140     ;; $XML_CATALOG_FILES lists 'catalog.xml' files found in under the 'xml'
141     ;; sub-directory of any given package.
142     (native-search-paths (list (search-path-specification
143                                 (variable "XML_CATALOG_FILES")
144                                 (separator " ")
145                                 (files '("xml"))
146                                 (file-pattern "^catalog\\.xml$")
147                                 (file-type 'regular))))
148     (search-paths native-search-paths)
149     (description
150      "Libxml2 is the XML C parser and toolkit developed for the Gnome
151 project (but it is usable outside of the Gnome platform).")
152     (license license:x11)))
154 (define-public python-libxml2
155   (package/inherit libxml2
156     (name "python-libxml2")
157     (build-system python-build-system)
158     (outputs '("out"))
159     (arguments
160      `(;; XXX: Tests are specified in 'Makefile.am', but not in 'setup.py'.
161        #:tests? #f
162        #:phases
163        (modify-phases %standard-phases
164          (add-before
165           'build 'configure
166           (lambda* (#:key inputs #:allow-other-keys)
167             (chdir "python")
168             (let ((glibc   (assoc-ref inputs ,(if (%current-target-system)
169                                                   "cross-libc" "libc")))
170                   (libxml2 (assoc-ref inputs "libxml2")))
171               (substitute* "setup.py"
172                 ;; For 'libxml2/libxml/tree.h'.
173                 (("ROOT = r'/usr'")
174                  (format #f "ROOT = r'~a'" libxml2))
175                 ;; For 'iconv.h'.
176                 (("/opt/include")
177                  (string-append glibc "/include"))))
178             #t)))))
179     (inputs `(("libxml2" ,libxml2)))
180     (synopsis "Python bindings for the libxml2 library")))
182 (define-public python2-libxml2
183   (package-with-python2 python-libxml2))
185 (define-public libxslt
186   (package
187     (name "libxslt")
188     (version "1.1.32")
189     (source (origin
190              (method url-fetch)
191              (uri (string-append "ftp://xmlsoft.org/libxslt/libxslt-"
192                                  version ".tar.gz"))
193              (sha256
194               (base32
195                "0q2l6m56iv3ysxgm2walhg4c9wp7q183jb328687i9zlp85csvjj"))
196              (patches (search-patches "libxslt-generated-ids.patch"))))
197     (build-system gnu-build-system)
198     (home-page "http://xmlsoft.org/XSLT/index.html")
199     (synopsis "C library for applying XSLT stylesheets to XML documents")
200     (inputs `(("libgcrypt" ,libgcrypt)
201               ("libxml2" ,libxml2)
202               ("python" ,python-minimal-wrapper)
203               ("zlib" ,zlib)))
204     (description
205      "Libxslt is an XSLT C library developed for the GNOME project.  It is
206 based on libxml for XML parsing, tree manipulation and XPath support.")
207     (license license:x11)))
209 (define-public perl-graph-readwrite
210   (package
211     (name "perl-graph-readwrite")
212     (version "2.09")
213     (source
214      (origin
215        (method url-fetch)
216        (uri (string-append
217              "mirror://cpan/authors/id/N/NE/NEILB/Graph-ReadWrite-"
218              version
219              ".tar.gz"))
220        (sha256
221         (base32
222          "0jlsg64pmy6ka5q5gy851nnyfgjzvhyxc576bhns3vi2x5ng07mh"))))
223     (build-system perl-build-system)
224     (propagated-inputs
225      `(("perl-graph" ,perl-graph)
226        ("perl-parse-yapp" ,perl-parse-yapp)
227        ("perl-xml-parser" ,perl-xml-parser)
228        ("perl-xml-writer" ,perl-xml-writer)))
229     (home-page "https://metacpan.org/release/Graph-ReadWrite")
230     (synopsis "Modules for reading and writing directed graphs")
231     (description "This is a collection of perl classes for reading and writing
232 directed graphs in a variety of file formats.  The graphs are represented in
233 Perl using Jarkko Hietaniemi's @code{Graph} classes.
235 There are two base classes. @code{Graph::Reader} is the base class for classes
236 which read a graph file and create an instance of the Graph class.
237 @code{Graph::Writer} is the base class for classes which take an instance of
238 the @code{Graph} class and write it out in a specific file format.")
239     (license license:perl-license)))
241 (define-public perl-xml-atom
242   (package
243     (name "perl-xml-atom")
244     (version "0.42")
245     (source (origin
246               (method url-fetch)
247               (uri (string-append "mirror://cpan/authors/id/M/MI/MIYAGAWA/"
248                                   "XML-Atom-" version ".tar.gz"))
249               (sha256
250                (base32
251                 "1wa8kfy1w4mg7kzxim4whyprkn48a2il6fap0b947zywknw4c6y6"))))
252     (build-system perl-build-system)
253     (arguments
254      `(#:phases
255        (modify-phases %standard-phases
256          (add-before 'check 'set-perl-search-path
257            (lambda _
258              (setenv "PERL5LIB"
259                      (string-append (getcwd) ":"
260                                     (getenv "PERL5LIB")))
261              #t)))))
262     (native-inputs
263      ;; TODO package: perl-datetime-format-atom
264      `(("perl-html-tagset" ,perl-html-tagset)
265        ("perl-module-build-tiny" ,perl-module-build-tiny)
266        ("perl-module-install" ,perl-module-install)))
267     (propagated-inputs
268      `(("perl-class-data-inheritable" ,perl-class-data-inheritable)
269        ("perl-datetime" ,perl-datetime)
270        ("perl-datetime-timezone" ,perl-datetime-timezone)
271        ("perl-digest-sha1" ,perl-digest-sha1)
272        ("perl-libwww" ,perl-libwww)
273        ("perl-uri" ,perl-uri)
274        ("perl-xml-libxml" ,perl-xml-libxml)
275        ("perl-xml-xpath" ,perl-xml-xpath)))
276     (home-page "https://metacpan.org/release/XML-Atom")
277     (synopsis "Atom feed and API implementation")
278     (description
279      "Atom is a syndication, API, and archiving format for weblogs and other data.
280 @code{XML::Atom} implements the feed format as well as a client for the API.")
281     (license license:perl-license)))
283 (define-public perl-xml-descent
284   (package
285     (name "perl-xml-descent")
286     (version "1.04")
287     (source (origin
288               (method url-fetch)
289               (uri (string-append "mirror://cpan/authors/id/A/AN/ANDYA/"
290                                   "XML-Descent-" version ".tar.gz"))
291               (sha256
292                (base32
293                 "0l5xmw2hd95ypppz3lyvp4sn02ccsikzjwacli3ydxfdz1bbh4d7"))))
294     (build-system perl-build-system)
295     (native-inputs
296      `(("perl-module-build" ,perl-module-build)))
297     (propagated-inputs
298      `(("perl-test-differences" ,perl-test-differences)
299        ("perl-xml-tokeparser" ,perl-xml-tokeparser)))
300     (home-page "https://metacpan.org/release/XML-Descent")
301     (synopsis "Recursive descent XML parsing")
302     (description
303      "The conventional models for parsing XML are either @dfn{DOM}
304 (a data structure representing the entire document tree is created) or
305 @dfn{SAX} (callbacks are issued for each element in the XML).
307 XML grammar is recursive - so it's nice to be able to write recursive
308 parsers for it.  @code{XML::Descent} allows such parsers to be created.")
309     (license license:perl-license)))
311 (define-public perl-xml-parser
312   (package
313     (name "perl-xml-parser")
314     (version "2.44")
315     (source (origin
316              (method url-fetch)
317              (uri (string-append
318                    "mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-"
319                    version ".tar.gz"))
320              (sha256
321               (base32
322                "05ij0g6bfn27iaggxf8nl5rhlwx6f6p6xmdav6rjcly3x5zd1s8s"))))
323     (build-system perl-build-system)
324     (arguments `(#:make-maker-flags
325                  (let ((expat (assoc-ref %build-inputs "expat")))
326                    (list (string-append "EXPATLIBPATH=" expat "/lib")
327                          (string-append "EXPATINCPATH=" expat "/include")))))
328     (inputs `(("expat" ,expat)))
329     (license license:perl-license)
330     (synopsis "Perl bindings to the Expat XML parsing library")
331     (description
332      "This module provides ways to parse XML documents.  It is built on top of
333 XML::Parser::Expat, which is a lower level interface to James Clark's expat
334 library.  Each call to one of the parsing methods creates a new instance of
335 XML::Parser::Expat which is then used to parse the document.  Expat options
336 may be provided when the XML::Parser object is created.  These options are
337 then passed on to the Expat object on each parse call.  They can also be given
338 as extra arguments to the parse methods, in which case they override options
339 given at XML::Parser creation time.")
340     (home-page "https://metacpan.org/release/XML-Parser")))
342 (define-public perl-xml-tokeparser
343   (package
344     (name "perl-xml-tokeparser")
345     (version "0.05")
346     (source (origin
347               (method url-fetch)
348               (uri (string-append "mirror://cpan/authors/id/P/PO/PODMASTER/"
349                                   "XML-TokeParser-" version ".tar.gz"))
350               (sha256
351                (base32
352                 "1hnpwb3lh6cbgwvjjgqzcp6jm4mp612qn6ili38adc9nhkwv8fc5"))))
353     (build-system perl-build-system)
354     (propagated-inputs `(("perl-xml-parser" ,perl-xml-parser)))
355     (home-page "https://metacpan.org/release/XML-TokeParser")
356     (synopsis "Simplified interface to XML::Parser")
357     (description
358      "@code{XML::TokeParser} provides a procedural (\"pull mode\") interface
359 to @code{XML::Parser} in much the same way that Gisle Aas'
360 @code{HTML::TokeParser} provides a procedural interface to @code{HTML::Parser}.
361 @code{XML::TokeParser} splits its XML input up into \"tokens\", each
362 corresponding to an @code{XML::Parser} event.")
363     (license license:perl-license)))
365 (define-public perl-libxml
366   (package
367     (name "perl-libxml")
368     (version "0.08")
369     (source (origin
370              (method url-fetch)
371              (uri (string-append
372                    "mirror://cpan/authors/id/K/KM/KMACLEOD/libxml-perl-"
373                    version ".tar.gz"))
374              (sha256
375               (base32
376                "1jy9af0ljyzj7wakqli0437zb2vrbplqj4xhab7bfj2xgfdhawa5"))))
377     (build-system perl-build-system)
378     (propagated-inputs
379      `(("perl-xml-parser" ,perl-xml-parser)))
380     (license license:perl-license)
381     (synopsis "Perl modules for working with XML")
382     (description
383      "libxml-perl is a collection of smaller Perl modules, scripts, and
384 documents for working with XML in Perl.  libxml-perl software works in
385 combination with @code{XML::Parser}, PerlSAX, @code{XML::DOM},
386 @code{XML::Grove}, and others.")
387     (home-page "https://metacpan.org/release/libxml-perl")))
389 (define-public perl-xml-libxml
390   (package
391     (name "perl-xml-libxml")
392     (version "2.0134")
393     (source
394      (origin
395        (method url-fetch)
396        (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
397                            "XML-LibXML-" version ".tar.gz"))
398        (sha256
399         (base32
400          "1ks69xymv6zkj7hvaymjvb78ch81abri7kg4zrwxhdfsqb8a9g7h"))))
401     (build-system perl-build-system)
402     (propagated-inputs
403      `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
404        ("perl-xml-sax" ,perl-xml-sax)))
405     (inputs
406      `(("libxml2" ,libxml2)))
407     (home-page "https://metacpan.org/release/XML-LibXML")
408     (synopsis "Perl interface to libxml2")
409     (description "This module implements a Perl interface to the libxml2
410 library which provides interfaces for parsing and manipulating XML files.  This
411 module allows Perl programmers to make use of the highly capable validating
412 XML parser and the high performance DOM implementation.")
413     (license license:perl-license)))
415 (define-public perl-xml-libxml-simple
416   (package
417     (name "perl-xml-libxml-simple")
418     (version "0.99")
419     (source (origin
420               (method url-fetch)
421               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
422                                   "XML-LibXML-Simple-" version ".tar.gz"))
423               (sha256
424                (base32
425                 "0i4ybiqdnvnbfxqslw2y392kvy7i752dl8n99bqiqv5kzk4lbzhl"))))
426     (build-system perl-build-system)
427     (propagated-inputs
428      `(("perl-file-slurp-tiny" ,perl-file-slurp-tiny)
429        ("perl-xml-libxml" ,perl-xml-libxml)))
430     (home-page "https://metacpan.org/release/XML-LibXML-Simple")
431     (synopsis "XML::LibXML based XML::Simple clone")
432     (description
433      "This package provides the same API as @code{XML::Simple} but is based on
434 @code{XML::LibXML}.")
435     (license license:perl-license)))
437 (define-public perl-xml-libxslt
438   (package
439     (name "perl-xml-libxslt")
440     (version "1.96")
441     (source
442      (origin
443        (method url-fetch)
444        (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
445                            "XML-LibXSLT-" version ".tar.gz"))
446        (sha256
447         (base32
448          "0wyl8klgr65j8y8fzgwz9jlvfjwvxazna8j3dg9gksd2v973fpia"))))
449     (build-system perl-build-system)
450     (inputs
451      `(("libxslt" ,libxslt)))
452     (propagated-inputs
453      `(("perl-xml-libxml" ,perl-xml-libxml)))
454     (home-page "https://metacpan.org/release/XML-LibXSLT")
455     (synopsis "Perl bindings to GNOME libxslt library")
456     (description "This Perl module is an interface to the GNOME project's
457 libxslt library.")
458     (license license:perl-license)))
460 (define-public perl-xml-namespacesupport
461   (package
462     (name "perl-xml-namespacesupport")
463     (version "1.12")
464     (source
465      (origin
466        (method url-fetch)
467        (uri (string-append "mirror://cpan/authors/id/P/PE/PERIGRIN/"
468                            "XML-NamespaceSupport-" version ".tar.gz"))
469        (sha256
470         (base32
471          "1vz5pbi4lm5fhq2slrs2hlp6bnk29863abgjlcx43l4dky2rbsa7"))))
472     (build-system perl-build-system)
473     (home-page "https://metacpan.org/release/XML-NamespaceSupport")
474     (synopsis "XML namespace support class")
475     (description "This module offers a simple to process namespaced XML
476 names (unames) from within any application that may need them.  It also helps
477 maintain a prefix to namespace URI map, and provides a number of basic
478 checks.")
479     (license license:perl-license)))
481 (define-public perl-xml-rss
482   (package
483     (name "perl-xml-rss")
484     (version "1.60")
485     (source (origin
486               (method url-fetch)
487               (uri (string-append "mirror://cpan/authors/id/S/SH/SHLOMIF/"
488                                   "XML-RSS-" version ".tar.gz"))
489               (sha256
490                (base32
491                 "0xw6aaqka3vqwbv152sbh6fbi8j306q1gvg7v83br8miif3mjcsb"))))
492     (build-system perl-build-system)
493     (native-inputs
494      `(("perl-module-build" ,perl-module-build)
495        ("perl-test-manifest" ,perl-test-manifest)
496        ("perl-test-differences" ,perl-test-differences)
497        ("perl-test-pod" ,perl-test-pod)
498        ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
499     ;; XXX: The test which uses this modules does not run, even when it is included
500     ;; it is ignored. ("perl-test-trailingspace" ,perl-test-trailingspace)
501     (inputs
502      `(("perl-datetime" ,perl-datetime)
503        ("perl-datetime-format-mail" ,perl-datetime-format-mail)
504        ("perl-datetime-format-w3cdtf" ,perl-datetime-format-w3cdtf)
505        ("perl-html-parser" ,perl-html-parser)
506        ("perl-xml-parser" ,perl-xml-parser)))
507     (home-page "https://metacpan.org/release/XML-RSS")
508     (synopsis "Creates and updates RSS files")
509     (description
510      "This module provides a basic framework for creating and maintaining
511 RDF Site Summary (RSS) files.  This distribution also contains many examples
512 that allow you to generate HTML from an RSS, convert between 0.9, 0.91, and
513 1.0 version, and more.")
514     (license license:perl-license)))
516 (define-public perl-xml-sax
517   (package
518     (name "perl-xml-sax")
519     (version "1.00")
520     (source
521      (origin
522        (method url-fetch)
523        (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
524                            "XML-SAX-" version ".tar.gz"))
525        (sha256
526         (base32
527          "1qra9k3wszjxvsgbragl55z3qba4nri0ipmjaxfib4l6xxj6bsj5"))))
528     (build-system perl-build-system)
529     (propagated-inputs
530      `(("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
531        ("perl-xml-sax-base" ,perl-xml-sax-base)))
532     (arguments
533      `(#:phases (modify-phases %standard-phases
534                   (add-before
535                    'install 'augment-path
536                    ;; The install target tries to load the newly-installed
537                    ;; XML::SAX module, but can't find it, so we need to tell
538                    ;; perl where to look.
539                    (lambda* (#:key outputs #:allow-other-keys)
540                      (setenv "PERL5LIB"
541                              (string-append (getenv "PERL5LIB") ":"
542                                             (assoc-ref outputs "out")
543                                             "/lib/perl5/site_perl"))
544                      #t)))))
545     (home-page "https://metacpan.org/release/XML-SAX")
546     (synopsis "Perl API for XML")
547     (description "XML::SAX consists of several framework classes for using and
548 building Perl SAX2 XML parsers, filters, and drivers.")
549     (license license:perl-license)))
551 (define-public perl-xml-sax-base
552   (package
553     (name "perl-xml-sax-base")
554     (version "1.09")
555     (source
556      (origin
557        (method url-fetch)
558        (uri (string-append "mirror://cpan/authors/id/G/GR/GRANTM/"
559                            "XML-SAX-Base-" version ".tar.gz"))
560        (sha256
561         (base32
562          "1l1ai9g1z11ja7mvnfl5mj346r13jyckbg9qlw6c2izglidkbjv6"))))
563     (build-system perl-build-system)
564     (home-page "https://metacpan.org/release/XML-SAX-Base")
565     (synopsis "Base class for SAX Drivers and Filters")
566     (description "This module has a very simple task - to be a base class for
567 PerlSAX drivers and filters.  It's default behaviour is to pass the input
568 directly to the output unchanged.  It can be useful to use this module as a
569 base class so you don't have to, for example, implement the characters()
570 callback.")
571     (license license:perl-license)))
573 (define-public perl-xml-simple
574   (package
575     (name "perl-xml-simple")
576     (version "2.25")
577     (source (origin
578              (method url-fetch)
579              (uri (string-append
580                    "mirror://cpan/authors/id/G/GR/GRANTM/XML-Simple-"
581                    version ".tar.gz"))
582              (sha256
583               (base32
584                "1y6vh328zrh085d40852v4ij2l4g0amxykswxd1nfhd2pspds7sk"))))
585     (build-system perl-build-system)
586     (propagated-inputs
587      `(("perl-xml-parser" ,perl-xml-parser)
588        ("perl-xml-sax" ,perl-xml-sax)))
589     (license license:perl-license)
590     (synopsis "Perl module for easy reading/writing of XML files")
591     (description
592      "The XML::Simple module provides a simple API layer on top of an
593 underlying XML parsing module (either XML::Parser or one of the SAX2
594 parser modules).")
595     (home-page "https://metacpan.org/release/XML-Simple")))
597 (define-public perl-xml-regexp
598   (package
599     (name "perl-xml-regexp")
600     (version "0.04")
601     (source (origin
602              (method url-fetch)
603              (uri (string-append
604                    "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-RegExp-"
605                    version ".tar.gz"))
606              (sha256
607               (base32
608                "0m7wj00a2kik7wj0azhs1zagwazqh3hlz4255n75q21nc04r06fz"))))
609     (build-system perl-build-system)
610     (inputs
611      `(("perl-xml-parser" ,perl-xml-parser)))
612     (license license:perl-license)
613     (synopsis "Perl regular expressions for XML tokens")
614     (description
615      "XML::RegExp contains regular expressions for the following XML tokens:
616 BaseChar, Ideographic, Letter, Digit, Extender, CombiningChar, NameChar,
617 EntityRef, CharRef, Reference, Name, NmToken, and AttValue.")
618     (home-page "https://metacpan.org/release/XML-RegExp")))
620 (define-public perl-xml-dom
621   (package
622     (name "perl-xml-dom")
623     (version "1.46")
624     (source (origin
625              (method url-fetch)
626              (uri (string-append
627                    "mirror://cpan/authors/id/T/TJ/TJMATHER/XML-DOM-"
628                    version ".tar.gz"))
629              (sha256
630               (base32
631                "0phpkc4li43m2g44hdcvyxzy9pymqwlqhh5hwp2xc0cv8l5lp8lb"))))
632     (build-system perl-build-system)
633     (propagated-inputs
634      `(("perl-libwww" ,perl-libwww)
635        ("perl-libxml" ,perl-libxml)
636        ("perl-xml-parser" ,perl-xml-parser)
637        ("perl-xml-regexp" ,perl-xml-regexp)))
638     (license license:perl-license)
639     (synopsis
640      "Perl module for building DOM Level 1 compliant document structures")
641     (description
642      "This module extends the XML::Parser module by Clark Cooper.  The
643 XML::Parser module is built on top of XML::Parser::Expat, which is a lower
644 level interface to James Clark's expat library.  XML::DOM::Parser is derived
645 from XML::Parser.  It parses XML strings or files and builds a data structure
646 that conforms to the API of the Document Object Model.")
647     (home-page "https://metacpan.org/release/XML-DOM")))
649 (define-public perl-xml-compile-tester
650   (package
651     (name "perl-xml-compile-tester")
652     (version "0.91")
653     (source (origin
654               (method url-fetch)
655               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
656                                   "XML-Compile-Tester-" version ".tar.gz"))
657               (sha256
658                (base32
659                 "1drzwziwi96rfkh48qpw4l225mcbk8ppl2157nj92cslcpwwdk75"))))
660     (build-system perl-build-system)
661     (propagated-inputs
662      `(("perl-log-report" ,perl-log-report)
663        ("perl-test-deep" ,perl-test-deep)))
664     (home-page "https://metacpan.org/release/XML-Compile-Tester")
665     (synopsis "XML::Compile related regression testing")
666     (description
667      "The @code{XML::Compile} module suite has extensive regression testing.
668 This module provide functions which simplify writing tests for
669 @code{XML::Compile} related distributions.")
670     (license license:perl-license)))
672 (define-public perl-xml-compile
673   (package
674     (name "perl-xml-compile")
675     (version "1.61")
676     (source (origin
677               (method url-fetch)
678               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
679                                   "XML-Compile-" version ".tar.gz"))
680               (sha256
681                (base32
682                 "13dvsaj8simivj867rkjlf7hhvvcwlahnhk70zf8cq2xbg8wmf7x"))))
683     (build-system perl-build-system)
684     (propagated-inputs
685      `(("perl-carp" ,perl-carp)
686        ("perl-log-report" ,perl-log-report)
687        ("perl-xml-compile-tester" ,perl-xml-compile-tester)
688        ("perl-xml-libxml" ,perl-xml-libxml)
689        ("perl-scalar-list-utils" ,perl-scalar-list-utils)
690        ("perl-test-deep" ,perl-test-deep)
691        ("perl-types-serialiser" ,perl-types-serialiser)))
692     (home-page "https://metacpan.org/release/XML-Compile")
693     (synopsis "Compilation-based XML processing")
694     (description
695      "@code{XML::Compile} can be used to translate a Perl data-structure into
696 XML or XML into a Perl data-structure, both directions under rigid control by
697 a schema.")
698     (license license:perl-license)))
700 (define-public perl-xml-compile-cache
701   (package
702     (name "perl-xml-compile-cache")
703     (version "1.06")
704     (source (origin
705               (method url-fetch)
706               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
707                                   "XML-Compile-Cache-" version ".tar.gz"))
708               (sha256
709                (base32
710                 "181qf1s7ymgi7saph3cf9p6dbxkxyh1ja23na4dchhi8v5mi66sr"))))
711     (build-system perl-build-system)
712     (propagated-inputs
713      `(("perl-log-report" ,perl-log-report)
714        ("perl-xml-compile" ,perl-xml-compile)
715        ("perl-xml-compile-tester" ,perl-xml-compile-tester)
716        ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)))
717     (home-page "https://metacpan.org/release/XML-Compile-Cache")
718     (synopsis "Cache compiled XML translators")
719     (description
720      "This package provides methods to cache compiled XML translators.")
721     (license license:perl-license)))
723 (define-public perl-xml-compile-soap
724   (package
725     (name "perl-xml-compile-soap")
726     (version "3.24")
727     (source (origin
728               (method url-fetch)
729               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
730                                   "XML-Compile-SOAP-" version ".tar.gz"))
731               (sha256
732                (base32
733                 "0pkcph562l2ij7rlwlvm58v6y062qsbydfpaz2qnph2ixqy0xfd1"))))
734     (build-system perl-build-system)
735     (propagated-inputs
736      `(("perl-file-slurp-tiny" ,perl-file-slurp-tiny)
737        ("perl-libwww" ,perl-libwww)
738        ("perl-log-report" ,perl-log-report)
739        ("perl-xml-compile" ,perl-xml-compile)
740        ("perl-xml-compile-cache" ,perl-xml-compile-cache)
741        ("perl-xml-compile-tester" ,perl-xml-compile-tester)))
742     (home-page "https://metacpan.org/release/XML-Compile-SOAP")
743     (synopsis "Base-class for SOAP implementations")
744     (description
745      "This module provides a class to handle the SOAP protocol.  The first
746 implementation is @url{SOAP1.1,
747 http://www.w3.org/TR/2000/NOTE-SOAP-20000508/}, which is still most often
748 used.")
749     (license license:perl-license)))
751 (define-public perl-xml-compile-wsdl11
752   (package
753     (name "perl-xml-compile-wsdl11")
754     (version "3.07")
755     (source (origin
756               (method url-fetch)
757               (uri (string-append "mirror://cpan/authors/id/M/MA/MARKOV/"
758                                   "XML-Compile-WSDL11-" version ".tar.gz"))
759               (sha256
760                (base32
761                 "09ayl442hzvn97q4ghn5rz4r82dm9w3l69hixhb29h9xq9ysi7ba"))))
762     (build-system perl-build-system)
763     (propagated-inputs
764      `(("perl-log-report" ,perl-log-report)
765        ("perl-xml-compile" ,perl-xml-compile)
766        ("perl-xml-compile-cache" ,perl-xml-compile-cache)
767        ("perl-xml-compile-soap" ,perl-xml-compile-soap)))
768     (home-page "https://metacpan.org/release/XML-Compile-WSDL11")
769     (synopsis "Create SOAP messages defined by WSDL 1.1")
770     (description
771      "This module understands WSDL version 1.1.  A WSDL file defines a set of
772 messages to be send and received over SOAP connections.  This involves
773 encoding of the message to be send into XML, sending the message to the
774 server, collect the answer, and finally decoding the XML to Perl.")
775     (license license:perl-license)))
777 (define-public perl-xml-feed
778   (package
779     (name "perl-xml-feed")
780     (version "0.59")
781     (source (origin
782               (method url-fetch)
783               (uri (string-append "mirror://cpan/authors/id/D/DA/DAVECROSS/"
784                                   "XML-Feed-" version ".tar.gz"))
785               (sha256
786                (base32
787                 "1z1a88bpy64j42bbyl8acbfl3dn9iaz47gx6clkgy5sbn4kr0kgk"))))
788     (build-system perl-build-system)
789     (arguments
790      `(#:tests? #f))                    ; tests require internet connection
791     (native-inputs
792      `(("perl-module-build" ,perl-module-build)
793        ("perl-uri" ,perl-uri)
794        ("perl-class-data-inheritable" ,perl-class-data-inheritable)))
795     (inputs
796      `(("perl-class-errorhandler" ,perl-class-errorhandler)
797        ("perl-datetime" ,perl-datetime)
798        ("perl-datetime-format-mail" ,perl-datetime-format-mail)
799        ("perl-datetime-format-w3cdtf" ,perl-datetime-format-w3cdtf)
800        ("perl-feed-find" ,perl-feed-find)
801        ("perl-html-parser" ,perl-html-parser)
802        ("perl-libwww-perl" ,perl-libwww)
803        ("perl-module-pluggable" ,perl-module-pluggable)
804        ("perl-uri-fetch" ,perl-uri-fetch)
805        ("perl-xml-atom" ,perl-xml-atom)
806        ("perl-xml-libxml" ,perl-xml-libxml)
807        ("perl-xml-rss" ,perl-xml-rss)))
808     (home-page "https://metacpan.org/release/XML-Feed")
809     (synopsis "XML Syndication Feed Support")
810     (description "@code{XML::Feed} is a syndication feed parser for both RSS and
811 Atom feeds.  It also implements feed auto-discovery for finding feeds, given a URI.
812 @code{XML::Feed} supports the following syndication feed formats:
813 RSS 0.91, RSS 1.0, RSS 2.0, Atom")
814     (license license:perl-license)))
816 (define-public perl-xml-xpath
817   (package
818     (name "perl-xml-xpath")
819     (version "1.44")
820     (source (origin
821               (method url-fetch)
822               (uri (string-append "mirror://cpan/authors/id/M/MA/MANWAR/"
823                                   "XML-XPath-" version ".tar.gz"))
824               (sha256
825                (base32
826                 "03yxj7w5a43ibbpiqsvb3lswj2b71dydsx4rs2fw0p8n0l3i3j8w"))))
827     (build-system perl-build-system)
828     (native-inputs
829      `(("perl-path-tiny" ,perl-path-tiny)))
830     (propagated-inputs
831      `(("perl-xml-parser" ,perl-xml-parser)))
832     (home-page "https://metacpan.org/release/XML-XPath")
833     (synopsis "Parse and evaluate XPath statements")
834     (description
835      "This module aims to comply exactly to the @url{XPath specification,
836 https://www.w3.org/TR/xpath} and yet allow extensions to be added in
837 the form of functions.")
838     (license license:perl-license)))
840 (define-public pugixml
841   (package
842     (name "pugixml")
843     (version "1.9")
844     (source
845      (origin
846       (method url-fetch)
847       (uri (string-append "https://github.com/zeux/pugixml/releases/download/v"
848                           version "/pugixml-" version ".tar.gz"))
849       (patches (search-patches "pugixml-versioned-libdir.patch"))
850       (sha256
851        (base32
852         "19nv3zhik3djp4blc4vrjwrl8dfhzmal8b21sq7y907nhddx6mni"))))
853     (build-system cmake-build-system)
854     (arguments
855      `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
856        #:tests? #f))                     ;no tests
857     (native-inputs
858      `(("pkg-config" ,pkg-config)))
859     (home-page "https://pugixml.org")
860     (synopsis "Light-weight, simple and fast XML parser for C++ with XPath support")
861     (description
862      "pugixml is a C++ XML processing library, which consists of a DOM-like
863 interface with rich traversal/modification capabilities, a fast XML parser
864 which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
865 implementation for complex data-driven tree queries.  Full Unicode support is
866 also available, with Unicode interface variants and conversions between
867 different Unicode encodings which happen automatically during
868 parsing/saving.")
869     (license license:expat)))
871 (define-public python-pyxb
872   (package
873     (name "python-pyxb")
874     (version "1.2.6")
875     (source (origin
876               (method url-fetch)
877               (uri (pypi-uri "PyXB" version))
878               (sha256
879                (base32
880                 "1d17pyixbfvjyi2lb0cfp0ch8wwdf44mmg3r5pwqhyyqs66z601a"))))
881     (build-system python-build-system)
882     (home-page "http://pyxb.sourceforge.net/")
883     (synopsis "Python XML Schema Bindings")
884     (description
885      "PyXB (\"pixbee\") is a pure Python package that generates Python source
886 code for classes that correspond to data structures defined by XMLSchema.")
887     (license (list license:asl2.0    ; Most files.
888                    license:expat     ; pyxb/utils/six.py
889                    license:gpl2      ; bundled jquery in doc is dual MIT/GPL2
890                    license:psfl))))  ; pyxb/utils/activestate.py
892 (define-public python2-pyxb
893   (package-with-python2 python-pyxb))
895 (define-public xmlto
896   (package
897     (name "xmlto")
898     (version "0.0.28")
899     (source
900      (origin
901       (method url-fetch)
902       ;; The old source on fedorahosted.org is offline permanently:
903       ;; <https://bugs.gnu.org/25989>
904       (uri (string-append "mirror://debian/pool/main/x/xmlto/"
905                           "xmlto_" version ".orig.tar.bz2"))
906       (file-name (string-append name "-" version ".tar.bz2"))
907       (sha256
908        (base32
909         "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i"))))
910     (build-system gnu-build-system)
911     (arguments
912      ;; Make sure the reference to util-linux's 'getopt' is kept in 'xmlto'.
913      '(#:configure-flags (list (string-append "GETOPT="
914                                               (assoc-ref %build-inputs
915                                                          "util-linux")
916                                               "/bin/getopt"))))
917     (inputs
918      `(("util-linux" ,util-linux)                 ; for 'getopt'
919        ("libxml2" ,libxml2)                       ; for 'xmllint'
920        ("libxslt" ,libxslt)))                     ; for 'xsltproc'
921     (home-page "http://cyberelk.net/tim/software/xmlto/")
922     (synopsis "Front-end to an XSL toolchain")
923     (description
924      "Xmlto is a front-end to an XSL toolchain.  It chooses an appropriate
925 stylesheet for the conversion you want and applies it using an external
926 XSL-T processor.  It also performs any necessary post-processing.")
927     (license license:gpl2+)))
929 (define-public xmlsec
930   (package
931     (name "xmlsec")
932     (version "1.2.28")
933     (source (origin
934               (method url-fetch)
935               (uri (string-append "https://www.aleksey.com/xmlsec/download/"
936                                   "xmlsec1-" version ".tar.gz"))
937               (sha256
938                (base32
939                 "1m12caglhyx08g8lh2sl3nkldlpryzdx2d572q73y3m33s0w9vhk"))))
940     (build-system gnu-build-system)
941     (propagated-inputs                  ; according to xmlsec1.pc
942      `(("libxml2" ,libxml2)
943        ("libxslt" ,libxslt)))
944     (inputs
945      `(("gnutls" ,gnutls)
946        ("libgcrypt" ,libgcrypt)
947        ("libltdl" ,libltdl)))
948     (native-inputs
949      `(("pkg-config" ,pkg-config)))
950     (home-page "https://www.aleksey.com/xmlsec/")
951     (synopsis "XML Security Library")
952     (description
953      "The XML Security Library is a C library based on Libxml2.  It
954 supports XML security standards such as XML Signature, XML Encryption,
955 Canonical XML (part of Libxml2) and Exclusive Canonical XML (part of
956 Libxml2).")
957     (license (license:x11-style "file://COPYING"
958                                 "See 'COPYING' in the distribution."))))
960 (define-public xmlsec-nss
961   (package
962     (inherit xmlsec)
963     (name "xmlsec-nss")
964     (native-inputs
965      ;; For tests.
966      `(("nss:bin" ,nss "bin")           ; for certutil
967        ,@(package-native-inputs xmlsec)))
968     (inputs
969      `(("nss" ,nss)
970        ("libltdl" ,libltdl)))
971     (synopsis "XML Security Library (using NSS instead of GnuTLS)")))
973 (define-public minixml
974   (package
975     (name "minixml")
976     (version "2.12")
977     (source (origin
978               (method url-fetch/tarbomb)
979               (uri (string-append "https://github.com/michaelrsweet/mxml/"
980                                   "releases/download/v" version
981                                   "/mxml-" version ".tar.gz"))
982               (sha256
983                (base32
984                 "1z8nqxa4pqdic8wpixkkgg1m2pak9wjikjjxnk3j5i0d29dbgmmg"))))
985     (build-system gnu-build-system)
986     (arguments
987      `(#:configure-flags
988        (list (string-append "LDFLAGS=-Wl,-rpath="
989                             (assoc-ref %outputs "out") "/lib"))
990        #:phases
991        (modify-phases %standard-phases
992          (add-after 'unpack 'fix-permissions
993            ;; FIXME: url-fetch/tarbomb resets all permissions to 555/444.
994            (lambda _
995              (for-each
996               (lambda (file)
997                 (chmod file #o644))
998               (find-files "doc" "\\."))
999              #t)))
1000        #:tests? #f))                    ; tests are run during build
1001     (home-page "https://michaelrsweet.github.io/mxml")
1002     (synopsis "Small XML parsing library")
1003     (description
1004      "Mini-XML is a small C library to read and write XML files and strings in
1005 UTF-8 and UTF-16 encoding.")
1006     ;; LGPL 2.0+ with additional exceptions for static linking
1007     (license license:lgpl2.0+)))
1009 ;; TinyXML is an unmaintained piece of software, so the patches and build
1010 ;; system massaging have no upstream potential.
1011 (define-public tinyxml
1012   (package
1013     (name "tinyxml")
1014     (version "2.6.2")
1015     (source (origin
1016               (method url-fetch)
1017               (uri (string-append "mirror://sourceforge/tinyxml/tinyxml/"
1018                                   version "/tinyxml_"
1019                                   (string-join (string-split version #\.) "_")
1020                                   ".tar.gz"))
1021               (file-name (string-append name "-" version ".tar.gz"))
1022               (sha256
1023                (base32
1024                 "14smciid19lvkxqznfig77jxn5s4iq3jpb47vh5a6zcaqp7gvg8m"))
1025               (patches (search-patches "tinyxml-use-stl.patch"))))
1026     (build-system gnu-build-system)
1027     ;; This library is missing *a lot* of the steps to make it usable, so we
1028     ;; have to add them here, like every other distro must do.
1029     (arguments
1030      `(#:phases
1031        (modify-phases %standard-phases
1032          (delete 'configure)
1033          (add-after 'build 'build-shared-library
1034            (lambda _
1035              (invoke "g++" "-Wall" "-O2" "-shared" "-fpic"
1036                      "tinyxml.cpp" "tinyxmlerror.cpp"
1037                      "tinyxmlparser.cpp" "tinystr.cpp"
1038                      "-o" "libtinyxml.so")))
1039          (replace 'check
1040            (lambda _ (invoke "./xmltest")))
1041          (replace 'install
1042            (lambda* (#:key outputs #:allow-other-keys)
1043              (let* ((out (assoc-ref outputs "out"))
1044                     (include (string-append out "/include"))
1045                     (lib (string-append out "/lib"))
1046                     (pkgconfig (string-append out "/lib/pkgconfig"))
1047                     (doc (string-append out "/share/doc")))
1048                ;; Install libs and headers.
1049                (install-file "libtinyxml.so" lib)
1050                (install-file "tinystr.h" include)
1051                (install-file "tinyxml.h" include)
1052                ;; Generate and install pkg-config file.
1053                (mkdir-p pkgconfig)
1054                ;; Software such as Kodi expect this file to be present, but
1055                ;; it's not provided in the source code.
1056                (call-with-output-file (string-append pkgconfig "/tinyxml.pc")
1057                  (lambda (port)
1058                    (format port "prefix=~a
1059 exec_prefix=${prefix}
1060 libdir=${exec_prefix}/lib
1061 includedir=${prefix}/include
1063 Name: TinyXML
1064 Description: A simple, small, C++ XML parser
1065 Version: ~a
1066 Libs: -L${libdir} -ltinyxml
1067 Cflags: -I${includedir}
1069                            out ,version)))
1070                ;; Install docs.
1071                (mkdir-p doc)
1072                (copy-recursively "docs" (string-append doc "tinyxml"))
1073                #t))))))
1074     (synopsis "Small XML parser for C++")
1075     (description "TinyXML is a small and simple XML parsing library for the
1076 C++ programming language.")
1077     (home-page "http://www.grinninglizard.com/tinyxml/index.html")
1078     (license license:zlib)))
1080 (define-public tinyxml2
1081   (package
1082     (name "tinyxml2")
1083     (version "4.0.1")
1084     (source
1085      (origin
1086        (method git-fetch)
1087        (uri (git-reference
1088              (url "https://github.com/leethomason/tinyxml2.git")
1089              (commit version)))
1090        (file-name (git-file-name name version))
1091        (sha256
1092         (base32 "1a0skfi8rzk53qcxbv88qlvhlqzvsvg4hm20dnx4zw7vrn6anr9y"))))
1093     (build-system cmake-build-system)
1094     (arguments
1095      `(#:tests? #f))                    ; no tests
1096     (synopsis "Small XML parser for C++")
1097     (description "TinyXML2 is a small and simple XML parsing library for the
1098 C++ programming language.")
1099     (home-page "http://www.grinninglizard.com/tinyxml2/")
1100     (license license:zlib)))
1102 (define-public xmlstarlet
1103  (package
1104    (name "xmlstarlet")
1105    (version "1.6.1")
1106    (source
1107     (origin
1108       (method url-fetch)
1109       (uri (string-append "mirror://sourceforge/xmlstar/xmlstarlet/"
1110                           version "/xmlstarlet-" version ".tar.gz"))
1111       (sha256
1112        (base32
1113         "1jp737nvfcf6wyb54fla868yrr39kcbijijmjpyk4lrpyg23in0m"))))
1114    (build-system gnu-build-system)
1115    (arguments
1116     '(#:phases
1117      (modify-phases %standard-phases
1118        (add-before 'check 'drop-failing-tests
1119          (lambda _
1120            ;; FIXME: Why are these tests failing.
1121            (substitute* "Makefile"
1122              (("^examples/schema1\\\\") "\\")
1123              (("^examples/valid1\\\\") "\\"))
1124            #t)))))
1125    (inputs
1126     `(("libxslt" ,libxslt)
1127       ("libxml2" ,libxml2)))
1128    (home-page "http://xmlstar.sourceforge.net/")
1129    (synopsis "Command line XML toolkit")
1130    (description "XMLStarlet is a set of command line utilities which can be
1131 used to transform, query, validate, and edit XML documents.  XPath is used to
1132 match and extract data, and elements can be added, deleted or modified using
1133 XSLT and EXSLT.")
1134    (license license:x11)))
1136 (define-public html-xml-utils
1137  (package
1138    (name "html-xml-utils")
1139    (version "7.7")
1140    (source
1141     (origin
1142       (method url-fetch)
1143       (uri (string-append
1144             "https://www.w3.org/Tools/HTML-XML-utils/html-xml-utils-"
1145             version ".tar.gz"))
1146       (sha256
1147        (base32
1148         "1vwqp5q276j8di9zql3kygf31z2frp2c59yjqlrvvwcvccvkcdwr"))))
1149    (build-system gnu-build-system)
1150    (home-page "https://www.w3.org/Tools/HTML-XML-utils/")
1151    (synopsis "Command line utilities to manipulate HTML and XML files")
1152    (description "HTML-XML-utils provides a number of simple utilities for
1153 manipulating and converting HTML and XML files in various ways.  The suite
1154 consists of the following tools:
1156 @itemize
1157  @item @command{asc2xml} convert from @code{UTF-8} to @code{&#nnn;} entities
1158  @item @command{xml2asc} convert from @code{&#nnn;} entities to @code{UTF-8}
1159  @item @command{hxaddid} add IDs to selected elements
1160  @item @command{hxcite} replace bibliographic references by hyperlinks
1161  @item @command{hxcite} mkbib - expand references and create bibliography
1162  @item @command{hxclean} apply heuristics to correct an HTML file
1163  @item @command{hxcopy} copy an HTML file while preserving relative links
1164  @item @command{hxcount} count elements and attributes in HTML or XML files
1165  @item @command{hxextract} extract selected elements
1166  @item @command{hxincl} expand included HTML or XML files
1167  @item @command{hxindex} create an alphabetically sorted index
1168  @item @command{hxmkbib} create bibliography from a template
1169  @item @command{hxmultitoc} create a table of contents for a set of HTML files
1170  @item @command{hxname2id} move some @code{ID=} or @code{NAME=} from A
1171 elements to their parents
1172  @item @command{hxnormalize} pretty-print an HTML file
1173  @item @command{hxnsxml} convert output of hxxmlns back to normal XML
1174  @item @command{hxnum} number section headings in an HTML file
1175  @item @command{hxpipe} convert XML to a format easier to parse with Perl or AWK
1176  @item @command{hxprintlinks} number links and add table of URLs at end of an HTML file
1177  @item @command{hxprune} remove marked elements from an HTML file
1178  @item @command{hxref} generate cross-references
1179  @item @command{hxselect} extract elements that match a (CSS) selector
1180  @item @command{hxtoc} insert a table of contents in an HTML file
1181  @item @command{hxuncdata} replace CDATA sections by character entities
1182  @item @command{hxunent} replace HTML predefined character entities to @code{UTF-8}
1183  @item @command{hxunpipe} convert output of pipe back to XML format
1184  @item @command{hxunxmlns} replace \"global names\" by XML Namespace prefixes
1185  @item @command{hxwls} list links in an HTML file
1186  @item @command{hxxmlns} replace XML Namespace prefixes by \"global names\"
1187 @end itemize
1189    (license license:expat)))
1191 (define-public xlsx2csv
1192   (package
1193     (name "xlsx2csv")
1194     (version "0.7.4")
1195     (source
1196      (origin
1197        (method git-fetch)
1198        (uri (git-reference
1199              (url "https://github.com/dilshod/xlsx2csv.git")
1200              (commit version)))
1201        (file-name (git-file-name name version))
1202        (sha256
1203         (base32 "168dm6p7w6pvgd87yb9hcxv9y0liv6mxgril202nfva68cp8y939"))))
1204     (build-system python-build-system)
1205     (arguments
1206      `(#:python ,python-2               ; use python-2 for the test script
1207        #:phases
1208        (modify-phases %standard-phases
1209          (replace 'check
1210            (lambda _
1211              (substitute* "test/run"
1212                ;; Run tests with `python' only.
1213                (("^(PYTHON_VERSIONS = ).*" all m) (string-append m "['']")))
1214              (invoke "test/run"))))))
1215     (home-page "https://github.com/dilshod/xlsx2csv")
1216     (synopsis "XLSX to CSV converter")
1217     (description
1218      "Xlsx2csv is a program to convert Microsoft Excel 2007 XML (XLSX and
1219 XLSM) format spreadsheets into plaintext @dfn{comma separated values} (CSV)
1220 files.  It is designed to be fast and to handle large input files.")
1221     (license license:gpl2+)))
1223 (define-public python-defusedxml
1224   (package
1225     (name "python-defusedxml")
1226     (version "0.5.0")
1227     (source
1228      (origin
1229        (method url-fetch)
1230        (uri (pypi-uri "defusedxml" version))
1231        (sha256
1232         (base32
1233          "1x54n0h8hl92vvwyymx883fbqpqjwn2mc8fb383bcg3z9zwz5mr4"))))
1234     (build-system python-build-system)
1235     (home-page "https://bitbucket.org/tiran/defusedxml")
1236     (synopsis "XML bomb protection for Python stdlib modules")
1237     (description
1238      "Defusedxml provides XML bomb protection for Python stdlib modules.")
1239     (license license:psfl)))
1241 (define-public python2-defusedxml
1242   (package-with-python2 python-defusedxml))
1244 (define-public freexl
1245   (package
1246     (name "freexl")
1247     (version "1.0.5")
1248     (source (origin
1249               (method url-fetch)
1250               (uri (string-append "http://www.gaia-gis.it/gaia-sins/"
1251                                   name  "-" version ".tar.gz"))
1252               (sha256
1253                (base32
1254                 "03bmwq6hngmzwpqpb7c2amqlspz4q69iv96nlf0f5c0qs98b3j9x"))))
1255     (build-system gnu-build-system)
1256     (home-page "https://www.gaia-gis.it/fossil/freexl/index")
1257     (synopsis "Read Excel files")
1258     (description
1259      "FreeXL is a C library to extract valid data from within an Excel (.xls)
1260 spreadsheet.")
1261     ;; Any of these licenses may be picked.
1262     (license (list license:gpl2+
1263                    license:lgpl2.1+
1264                    license:mpl1.1))))
1266 (define-public xerces-c
1267   (package
1268     (name "xerces-c")
1269     (version "3.1.4")
1270     (source (origin
1271               (method url-fetch)
1272               (uri (string-append "mirror://apache/xerces/c/3/sources/"
1273                                   "xerces-c-" version ".tar.xz"))
1274               (sha256
1275                (base32
1276                 "0hb29c0smqlpxj0zdm09s983z5jx37szlliccnvgh0qq91wwqwwr"))))
1277     (build-system gnu-build-system)
1278     (arguments
1279      (let ((system (or (%current-target-system)
1280                        (%current-system))))
1281        (if (string-prefix? "x86_64" system)
1282            '()
1283            '(#:configure-flags '("--disable-sse2")))))
1284     (native-inputs
1285      `(("perl" ,perl)))
1286     (home-page "http://xerces.apache.org/xerces-c/")
1287     (synopsis "Validating XML parser library for C++")
1288     (description "Xerces-C++ is a validating XML parser written in a portable
1289 subset of C++.  Xerces-C++ makes it easy to give your application the ability
1290 to read and write XML data.  A shared library is provided for parsing,
1291 generating, manipulating, and validating XML documents using the DOM, SAX, and
1292 SAX2 APIs.")
1293     (license license:asl2.0)))
1295 (define-public java-simple-xml
1296   (package
1297     (name "java-simple-xml")
1298     (version "2.7.1")
1299     (source (origin
1300               (method url-fetch)
1301               (uri (string-append "mirror://sourceforge/simple/simple-xml-"
1302                                   version ".zip"))
1303               (sha256
1304                (base32
1305                 "0w19k1awslmihpwsxwjbg89hv0vjhk4k3i0vrfchy3mqknd988y5"))
1306               (patches (search-patches "java-simple-xml-fix-tests.patch"))))
1307     (build-system ant-build-system)
1308     (arguments
1309      `(#:build-target "build"
1310        #:test-target "test"
1311        #:phases
1312        (modify-phases %standard-phases
1313          (replace 'install (install-jars "jar")))))
1314     (native-inputs
1315      `(("unzip" ,unzip)))
1316     (home-page "http://simple.sourceforge.net/")
1317     (synopsis "XML serialization framework for Java")
1318     (description "Simple is a high performance XML serialization and
1319 configuration framework for Java.  Its goal is to provide an XML framework
1320 that enables rapid development of XML configuration and communication systems.
1321 This framework aids the development of XML systems with minimal effort and
1322 reduced errors.  It offers full object serialization and deserialization,
1323 maintaining each reference encountered.")
1324     (license license:asl2.0)))
1326 (define-public perl-xml-xpathengine
1327   (package
1328     (name "perl-xml-xpathengine")
1329     (version "0.14")
1330     (source (origin
1331               (method url-fetch)
1332               (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/"
1333                                   "XML-XPathEngine-" version ".tar.gz"))
1334               (sha256
1335                (base32
1336                 "0r72na14bmsxfd16s9nlza155amqww0k8wsa9x2a3sqbpp5ppznj"))))
1337     (build-system perl-build-system)
1338     (home-page "https://metacpan.org/release/XML-XPathEngine")
1339     (synopsis "Re-usable XPath engine for DOM-like trees")
1340     (description
1341      "This module provides an XPath engine, that can be re-used by other
1342 modules/classes that implement trees.
1344 In order to use the XPath engine, nodes in the user module need to mimick DOM
1345 nodes.  The degree of similitude between the user tree and a DOM dictates how
1346 much of the XPath features can be used.  A module implementing all of the DOM
1347 should be able to use this module very easily (you might need to add the
1348 @code{cmp} method on nodes in order to get ordered result sets).")
1349     (license license:perl-license)))
1351 (define-public perl-tree-xpathengine
1352   (package
1353     (name "perl-tree-xpathengine")
1354     (version "0.05")
1355     (source (origin
1356               (method url-fetch)
1357               (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/"
1358                                   "Tree-XPathEngine-" version ".tar.gz"))
1359               (sha256
1360                (base32
1361                 "1vbbw8wxm79r3xbra8narw1dqvm34510q67wbmg2zmj6zd1k06r9"))))
1362     (build-system perl-build-system)
1363     (home-page "https://metacpan.org/release/Tree-XPathEngine")
1364     (synopsis "Re-usable XPath engine")
1365     (description
1366      "This module provides an XPath engine, that can be re-used by other
1367 module/classes that implement trees.  It is designed to be compatible with
1368 @code{Class::XPath}, ie it passes its tests if you replace @code{Class::XPath}
1369 by @code{Tree::XPathEngine}.")
1370     (license license:perl-license)))
1372 (define-public perl-xml-filter-buffertext
1373   (package
1374     (name "perl-xml-filter-buffertext")
1375     (version "1.01")
1376     (source
1377      (origin
1378        (method url-fetch)
1379        (uri (string-append "mirror://cpan/authors/id/R/RB/RBERJON/"
1380                            "XML-Filter-BufferText-" version ".tar.gz"))
1381        (sha256
1382         (base32
1383          "0p5785c1dsk6kdp505vapb5h54k8krrz8699hpgm9igf7dni5llg"))))
1384     (build-system perl-build-system)
1385     (propagated-inputs
1386      `(("perl-xml-sax-base" ,perl-xml-sax-base)))
1387     (home-page "https://metacpan.org/release/XML-Filter-BufferText")
1388     (synopsis "Filter to put all characters() in one event")
1389     (description "This is a very simple filter.  One common cause of
1390 grief (and programmer error) is that XML parsers aren't required to provide
1391 character events in one chunk.  They can, but are not forced to, and most
1392 don't.  This filter does the trivial but oft-repeated task of putting all
1393 characters into a single event.")
1394     (license license:perl-license)))
1396 (define-public perl-xml-sax-writer
1397   (package
1398     (name "perl-xml-sax-writer")
1399     (version "0.57")
1400     (source (origin
1401               (method url-fetch)
1402               (uri (string-append
1403                     "mirror://cpan/authors/id/P/PE/PERIGRIN/"
1404                     "XML-SAX-Writer-" version ".tar.gz"))
1405               (sha256
1406                (base32
1407                 "1w1cd1ybxdvhmnxdlkywi3x5ka3g4md42kyynksjc09vyizd0q9x"))))
1408     (build-system perl-build-system)
1409     (propagated-inputs
1410      `(("perl-libxml" ,perl-libxml)
1411        ("perl-xml-filter-buffertext" ,perl-xml-filter-buffertext)
1412        ("perl-xml-namespacesupport" ,perl-xml-namespacesupport)
1413        ("perl-xml-sax-base" ,perl-xml-sax-base)))
1414     (home-page "https://metacpan.org/release/XML-SAX-Writer")
1415     (synopsis "SAX2 XML Writer")
1416     (description
1417      "This is an XML writer that understands SAX2.  It is based on
1418 @code{XML::Handler::YAWriter}.")
1419     (license license:perl-license)))
1421 (define-public perl-xml-handler-yawriter
1422   (package
1423     (name "perl-xml-handler-yawriter")
1424     (version "0.23")
1425     (source
1426      (origin
1427        (method url-fetch)
1428        (uri (string-append "mirror://cpan/authors/id/K/KR/KRAEHE/"
1429                            "XML-Handler-YAWriter-" version ".tar.gz"))
1430        (sha256
1431         (base32
1432          "11d45a1sz862va9rry3p2m77pwvq3kpsvgwhc5ramh9mbszbnk77"))))
1433     (build-system perl-build-system)
1434     (propagated-inputs
1435      `(("perl-libxml" ,perl-libxml)))
1436     (home-page "https://metacpan.org/release/XML-Handler-YAWriter")
1437     (synopsis "Yet another Perl SAX XML Writer")
1438     (description "YAWriter implements Yet Another @code{XML::Handler::Writer}.
1439 It provides a flexible escaping technique and pretty printing.")
1440     (license license:perl-license)))
1442 (define-public perl-xml-twig
1443   (package
1444     (name "perl-xml-twig")
1445     (version "3.52")
1446     (source (origin
1447               (method url-fetch)
1448               (uri (string-append "mirror://cpan/authors/id/M/MI/MIROD/"
1449                                   "XML-Twig-" version ".tar.gz"))
1450               (sha256
1451                (base32
1452                 "1bc0hrz4jp6199hi29sdxmb9gyy45whla9hd19yqfasgq8k5ixzy"))))
1453     (build-system perl-build-system)
1454     (inputs
1455      `(("expat" ,expat)))
1456     (propagated-inputs
1457      `(("perl-html-tidy" ,perl-html-tidy)
1458        ("perl-html-tree" ,perl-html-tree)
1459        ("perl-io-captureoutput" ,perl-io-captureoutput)
1460        ("perl-io-string" ,perl-io-string)
1461        ("perl-io-stringy" ,perl-io-stringy)
1462        ("perl-libxml" ,perl-libxml)
1463        ("perl-xml-filter-buffertext" ,perl-xml-filter-buffertext)
1464        ("perl-xml-handler-yawriter" ,perl-xml-handler-yawriter)
1465        ("perl-xml-parser" ,perl-xml-parser)
1466        ("perl-xml-sax-writer" ,perl-xml-sax-writer)
1467        ("perl-xml-simple" ,perl-xml-simple)
1468        ("perl-xml-xpathengine" ,perl-xml-xpathengine)
1469        ("perl-test-pod" ,perl-test-pod)
1470        ("perl-tree-xpathengine" ,perl-tree-xpathengine)))
1471     (home-page "https://metacpan.org/release/XML-Twig")
1472     (synopsis "Perl module for processing huge XML documents in tree mode")
1473     (description "@code{XML::Twig} is an XML transformation module.  Its
1474 strong points: can be used to process huge documents while still being in tree
1475 mode; not bound by DOM or SAX, so it is very perlish and offers a very
1476 comprehensive set of methods; simple to use; DWIMs as much as possible.
1478 What it doesn't offer: full SAX support (it can export SAX, but only reads
1479 XML), full XPath support (unless you use @code{XML::Twig::XPath}), nor DOM
1480 support.")
1481     (license license:perl-license)))
1483 ;; TODO: Debian builds several jars out of this: jaxp-1.4.jar,
1484 ;; xml-apis.jar and xml-apis-1.4.01.jar.
1485 (define-public java-jaxp
1486   (package
1487     (name "java-jaxp")
1488     (version "1.4.01")
1489     (source
1490      (origin
1491        (method url-fetch)
1492        (uri (string-append "mirror://apache/xerces/xml-commons/source/"
1493                            "xml-commons-external-" version "-src.tar.gz"))
1494        (sha256
1495         (base32 "0rhq32a7dl9yik7zx9h0naz2iz068qgcdiayak91wp4wr26xhjyk"))))
1496     (build-system ant-build-system)
1497     (arguments
1498      `(#:jar-name "jaxp.jar"
1499        #:jdk ,icedtea-8
1500        #:source-dir ".."
1501        #:tests? #f)); no tests
1502     (home-page "http://xerces.apache.org/xml-commons/")
1503     (synopsis "Java XML parser and transformer APIs (DOM, SAX, JAXP, TrAX)")
1504     (description "Jaxp from the Apache XML Commons project is used by
1505 the Xerces-J XML parser and Xalan-J XSLT processor and specifies these APIs:
1507 @itemize
1508 @item Document Object Model (DOM)
1509 @item Simple API for XML (SAX)
1510 @item Java APIs for XML Processing (JAXP)
1511 @item Transformation API for XML (TrAX)
1512 @item Document Object Model (DOM) Load and Save
1513 @item JSR 206 Java API for XML Processing
1514 @end itemize")
1515     (license (list license:asl2.0
1516                    license:w3c ;; Files under org.w3c
1517                    license:public-domain)))) ;; org.xml.sax
1519 (define-public java-apache-xml-commons-resolver
1520   (package
1521     (name "java-apache-xml-commons-resolver")
1522     (version "1.2")
1523     (source
1524      (origin
1525        (method url-fetch)
1526        (uri (string-append "mirror://apache/xerces/xml-commons/"
1527                            "xml-commons-resolver-" version ".tar.gz"))
1528        (sha256
1529         (base32 "1zhy4anc3fg9f8y348bj88vmab15aavrg6nf419ifb25asyygnsm"))
1530        (modules '((guix build utils)))
1531        (snippet
1532         '(begin
1533            (for-each delete-file (find-files "." ".*\\.(jar|zip)"))
1534            #t))))
1535     (build-system ant-build-system)
1536     (arguments
1537      `(#:jar-name (string-append "xml-resolver.jar")
1538        #:tests? #f)); no tests
1539     (inputs
1540      `(("java-junit" ,java-junit)))
1541     (home-page "http://xerces.apache.org/xml-commons/")
1542     (synopsis "Catalog-based entity and URI resolution")
1543     (description "The resolver class implements the full semantics of OASIS Technical
1544 Resolution 9401:1997 (Amendment 2 to TR 9401) catalogs and the 06 Aug
1545 2001 Committee Specification of OASIS XML Catalogs.
1547 It also includes a framework of classes designed to read catalog files
1548 in a number of formats:
1550 @itemize
1551 @item The plain-text flavor described by TR9401.
1552 @item The XCatalog XML format defined by John Cowan
1553 @item The XML Catalog format defined by the OASIS Entity Resolution
1554       Technical Committee.
1555 @end itemize")
1556     (license license:asl2.0)))
1558 ;; Jaxen requires java-dom4j and java-xom that in turn require jaxen.
1559 ;; This package is a bootstrap version without dependencies on dom4j and xom.
1560 (define java-jaxen-bootstrap
1561   (package
1562     (name "java-jaxen-bootstrap")
1563     (version "1.1.6")
1564     (source (origin
1565               (method url-fetch)
1566               ;; No release on github
1567               (uri (string-append "https://repo1.maven.org/maven2/jaxen/jaxen/"
1568                                   version "/jaxen-" version "-sources.jar"))
1569               (sha256
1570                (base32
1571                 "18pa8mks3gfhazmkyil8wsp6j1g1x7rggqxfv4k2mnixkrj5x1kx"))))
1572     (build-system ant-build-system)
1573     (arguments
1574      `(#:jar-name "jaxen.jar"
1575        #:source-dir "src"
1576        #:tests? #f; no tests
1577        #:phases
1578        (modify-phases %standard-phases
1579          (add-before 'build 'remove-dom4j
1580            (lambda _
1581              (delete-file-recursively "src/org/jaxen/dom4j")
1582              (delete-file-recursively "src/org/jaxen/xom")
1583              #t)))))
1584     (inputs
1585      `(("java-jdom" ,java-jdom)))
1586     (home-page "https://github.com/jaxen-xpath/jaxen")
1587     (synopsis "XPath library")
1588     (description "Jaxen is an XPath library written in Java.  It is adaptable
1589 to many different object models, including DOM, XOM, dom4j, and JDOM.  It is
1590 also possible to write adapters that treat non-XML trees such as compiled
1591 Java byte code or Java beans as XML, thus enabling you to query these trees
1592 with XPath too.")
1593     (license license:bsd-3)))
1595 (define-public java-jaxen
1596   (package
1597     (inherit java-jaxen-bootstrap)
1598     (name "java-jaxen")
1599     (inputs
1600      `(("java-jdom" ,java-jdom)
1601        ("java-xom" ,java-xom)
1602        ("java-dom4j" ,java-dom4j)))))
1604 (define-public java-xom
1605   (package
1606     (name "java-xom")
1607     (version "127")
1608     (source (origin
1609               (method git-fetch)
1610               (uri (git-reference
1611                     (url "https://github.com/elharo/xom.git")
1612                     (commit (string-append "XOM_" version))))
1613               (file-name (git-file-name name version))
1614               (sha256
1615                (base32
1616                 "1jh6y03g5zzdhsb5jm6ms1xnamr460qmn96y3w6aw0ikfwqlg0bq"))
1617               (modules '((guix build utils)))
1618               (snippet
1619                '(begin
1620                   (for-each delete-file
1621                             (find-files "." "\\.jar$"))
1622                   #t))))
1623     (build-system ant-build-system)
1624     (arguments
1625      `(#:jar-name "xom.jar"
1626        #:jdk ,icedtea-8
1627        #:tests? #f                      ; no tests
1628        #:phases
1629        (modify-phases %standard-phases
1630          (add-after 'unpack 'make-git-checkout-writable
1631            (lambda _
1632              (for-each make-file-writable (find-files "."))
1633              #t))
1634          (add-before 'configure 'fix-tagsoup-dep
1635            (lambda _
1636              ;; FIXME: Where is tagsoup source?
1637              (delete-file "src/nu/xom/tools/XHTMLJavaDoc.java")
1638              #t)))))
1639     (inputs
1640      `(("java-jdom" ,java-jdom)
1641        ("java-junit" ,java-junit)
1642        ("java-classpathx-servletapi" ,java-classpathx-servletapi)
1643        ("java-jaxen-bootstrap" ,java-jaxen-bootstrap)
1644        ("java-xerces" ,java-xerces)))
1645     (home-page "https://xom.nu/")
1646     (synopsis "XML Object Model")
1647     (description "XOM is a new XML Object Model for processing XML with Java 
1648 that strives for correctness and simplicity.")
1649     ;; 2.1 only
1650     (license license:lgpl2.1)))
1652 (define-public java-xsdlib
1653   (package
1654     (name "java-xsdlib")
1655     (version "2013.2")
1656     (source (origin
1657               (method url-fetch)
1658               (uri (string-append "http://central.maven.org/maven2/com/sun/msv/"
1659                                   "datatype/xsd/xsdlib/" version "/xsdlib-"
1660                                   version "-sources.jar"))
1661               (sha256
1662                (base32
1663                 "185i48p1xp09wbq03i9zgfl701qa262rq46yf4cajzmk3336kqim"))))
1664     (build-system ant-build-system)
1665     (arguments
1666      `(#:tests? #f; no tests
1667        #:jar-name "xsdlib.jar"
1668        #:jdk ,icedtea-8))
1669     (inputs
1670      `(("java-xerces" ,java-xerces)))
1671     (home-page "http://central.maven.org/maven2/com/sun/msv/datatype/xsd/xsdlib/")
1672     (synopsis "Sun Multi-Schema Validator")
1673     (description "Xsdlib contains an implementation of sun.com.msv, an XML
1674 validator.")
1675     (license license:bsd-2)))
1677 (define-public java-xpp3
1678   (package
1679     (name "java-xpp3")
1680     (version "1.1.4")
1681     (source (origin
1682               (method url-fetch)
1683               (uri (string-append "http://www.extreme.indiana.edu/dist/"
1684                                   "java-repository/xpp3/distributions/xpp3-"
1685                                   version "_src.tgz"))
1686               (sha256
1687                (base32
1688                 "1b99zrhyij5qwyhilyjdl1ykxvhk902vsvflh6gx4fir8hfvdl5p"))
1689               (modules '((guix build utils)))
1690               (snippet
1691                 '(begin ;; Delete bundled jar archives.
1692                    (for-each delete-file (find-files "." ".*\\.jar"))
1693                    #t))))
1694     (build-system ant-build-system)
1695     (arguments
1696      `(#:tests? #f; no tests
1697        #:build-target "jar"
1698        #:phases
1699        (modify-phases %standard-phases
1700          (replace 'install (install-jars "build")))))
1701     (home-page "http://www.extreme.indiana.edu/xgws/xsoap/xpp/")
1702     (synopsis "Streaming pull XML parser")
1703     (description "Xml Pull Parser (in short XPP) is a streaming pull XML
1704 parser and should be used when there is a need to process quickly and
1705 efficiently all input elements (for example in SOAP processors). This
1706 package is a stable XmlPull parsing engine that is based on ideas from XPP
1707 and in particular XPP2 but completely revised and rewritten to take the best
1708 advantage of JIT JVMs.")
1709     (license (license:non-copyleft "file://LICENSE.txt"))))
1711 (define-public java-xmlpull2
1712   (package
1713     (name "java-xmlpull2")
1714     (version "2.1.10")
1715     (source (origin
1716               (method url-fetch)
1717               (uri (string-append "http://www.extreme.indiana.edu/xgws/xsoap/"
1718                                   "PullParser/PullParser" version ".tgz"))
1719               (sha256
1720                (base32
1721                 "1kw9nhyqb7bzhn2zjbwlpi5vp5rzj89amzi3hadw2acyh2dmd0md"))
1722               (modules '((guix build utils)))
1723               (snippet
1724                 '(begin ;; Delete bundled jar archives.
1725                    (for-each delete-file (find-files "." ".*\\.jar"))
1726                    #t))))
1727     (build-system ant-build-system)
1728     (arguments
1729      `(#:tests? #f; no tests
1730        #:build-target "impl"
1731        #:phases
1732        (modify-phases %standard-phases
1733          (replace 'install (install-jars "build/lib")))))
1734     (home-page "http://www.extreme.indiana.edu/xgws/xsoap/xpp/")
1735     (synopsis "Streaming pull XML parser")
1736     (description "Xml Pull Parser (in short XPP) is a streaming pull XML
1737 parser and should be used when there is a need to process quickly and
1738 efficiently all input elements (for example in SOAP processors).  This
1739 package is in maintenance mode.")
1740     (license (license:non-copyleft "file:///LICENSE.txt"))))
1742 (define-public java-dom4j
1743   (package
1744     (name "java-dom4j")
1745     (version "2.1.0")
1746     (source (origin
1747               (method git-fetch)
1748               (uri (git-reference
1749                     (url "https://github.com/dom4j/dom4j.git")
1750                     (commit (string-append "version-" version))))
1751               (file-name (git-file-name name version))
1752               (sha256
1753                (base32
1754                 "1827jljs8mps489fm7xw63cakdqwc5grilrr5n9spr2rlk76jpx3"))
1755               (modules '((guix build utils)))
1756               (snippet
1757                 '(begin ;; Delete bundled jar archives.
1758                    (for-each delete-file (find-files "." ".*\\.jar"))
1759                    #t))))
1760     (build-system ant-build-system)
1761     (arguments
1762      `(#:jar-name "dom4j.jar"
1763        #:jdk ,icedtea-8
1764        #:source-dir "src/main/java"
1765        ;; FIXME: Requires xalan, but xalan depends on java-cup which has a
1766        ;; dependency on itself through jflex.
1767        #:tests? #f
1768        #:phases
1769        (modify-phases %standard-phases
1770          (add-before 'build 'copy-jaxen-sources
1771            ;; java-jaxen-bootstrap is not enough. These files have a circular
1772            ;; dependency and there is no subset of dom4j that would allow
1773            ;; breaking the circle.
1774            (lambda* (#:key inputs #:allow-other-keys)
1775              (mkdir-p "jaxen-sources")
1776              (with-directory-excursion "jaxen-sources"
1777                (system* "jar" "xf" (assoc-ref inputs "java-jaxen-sources")))
1778              (mkdir-p "src/main/java/org/jaxen/dom4j")
1779              (copy-file "jaxen-sources/org/jaxen/dom4j/DocumentNavigator.java"
1780                         "src/main/java/org/jaxen/dom4j/DocumentNavigator.java")
1781              (copy-file "jaxen-sources/org/jaxen/dom4j/Dom4jXPath.java"
1782                         "src/main/java/org/jaxen/dom4j/Dom4jXPath.java")
1783              #t))
1784          (add-before 'build 'fix-old-xpp2
1785            (lambda _
1786              ;; This package normally depends on xpp2 2.0, but version 2.1.10
1787              ;; is the only version whose source code is published.
1788              (substitute* "src/main/java/org/dom4j/xpp/ProxyXmlStartTag.java"
1789                (("public void resetStartTag")
1790                 "public boolean removeAttributeByRawName(String name) {\n
1791   return false;\n
1793 public boolean removeAttributeByName(String name, String name2) {\n
1794   return false;\n
1795 }\n\npublic void resetStartTag")
1796                (("Atttribute") "Attribute"))
1797              #t)))))
1798     (inputs
1799      `(("java-jaxen-bootstrap" ,java-jaxen-bootstrap)
1800        ("java-jaxen-sources" ,(package-source java-jaxen-bootstrap))
1801        ("java-xmlpull2" ,java-xmlpull2)
1802        ("java-xpp3" ,java-xpp3)
1803        ("java-xsdlib" ,java-xsdlib)))
1804     (native-inputs
1805      `(("java-testng" ,java-testng)
1806        ("java-xerces" ,java-xerces)))
1807     (home-page "https://dom4j.github.io/")
1808     (synopsis "Flexible XML framework for Java")
1809     (description "Dom4j is a flexible XML framework for Java.  DOM4J works
1810 with DOM, SAX, XPath, and XSLT.  It can parse large XML documents with very
1811 low memory footprint.")
1812     ;; some BSD-like 5-clause license
1813     (license (license:non-copyleft "file://LICENSE"))))
1815 (define-public java-kxml2
1816   (package
1817     (name "java-kxml2")
1818     (version "2.4.2")
1819     (source (origin
1820               (method git-fetch)
1821               (uri (git-reference
1822                     (url "https://github.com/stefanhaustein/kxml2.git")
1823                     (commit (string-append "v" version))))
1824               (file-name (git-file-name name version))
1825               (sha256
1826                (base32
1827                 "0g6d8c9r9sh3x04sf4wdpgwvhkqvk11k3kq9skx91i60h4vn01hg"))))
1828     (build-system ant-build-system)
1829     (arguments
1830      `(#:jar-name "kxml2.jar"
1831        #:source-dir "src/main/java"
1832        #:test-include (list "TestWb.java")
1833        ;; Test failure: it was expected to get an XML entity but got the
1834        ;; equivalent Unicode character instead.
1835        #:tests? #f
1836        #:phases
1837        (modify-phases %standard-phases
1838          (add-after 'unpack 'make-git-checkout-writable
1839            (lambda _
1840              (for-each make-file-writable (find-files "."))
1841              #t))
1842          (add-before 'build 'copy-resources
1843            (lambda _
1844              (copy-recursively "src/main/resources" "build/classes")
1845              #t)))))
1846     (inputs
1847      `(("java-xpp3" ,java-xpp3)))
1848     (native-inputs
1849      `(("java-junit" ,java-junit)))
1850     (home-page "http://kxml.org")
1851     (synopsis "XML pull parser")
1852     (description "kXML is a small XML pull parser, specially designed for
1853 constrained environments such as Applets, Personal Java or devices compliant
1854 with the Mobile Information Device Profile (MIDP).")
1855     (license license:expat)))
1857 (define-public java-stax
1858   (package
1859     (name "java-stax")
1860     (version "1.2.0")
1861     (source (origin
1862               (method url-fetch)
1863               (uri (string-append "https://repo1.maven.org/maven2/stax/stax/"
1864                                   version "/stax-" version "-sources.jar"))
1865               (sha256
1866                (base32
1867                 "04ba4qvbrps45j8bldbakxq31k7gjlsay9pppa9yn13fr00q586z"))))
1868     (build-system ant-build-system)
1869     (arguments
1870      `(#:jar-name "stax.jar"
1871        #:tests? #f; no tests
1872        #:phases
1873        (modify-phases %standard-phases
1874          (add-before 'configure 'fix-utf8
1875            (lambda _
1876              ;; This file is ISO-8859-1 but java expects UTF-8.
1877              ;; Remove special characters in comments.
1878              (with-fluids ((%default-port-encoding "ISO-8859-1"))
1879                (substitute* "src/com/wutka/dtd/Scanner.java"
1880                  (("//.*") "\n")))
1881              #t)))))
1882     (home-page "https://repo1.maven.org/maven2/stax/stax/")
1883     (synopsis "Streaming API for XML")
1884     (description "This package provides the reference implementation of the
1885 @dfn{Streaming API for XML} (StAX).  It is used for streaming XML data to
1886 and from a Java application.  It provides a standard pull parser interface.")
1887     (license license:asl2.0)))
1889 (define-public java-jettison
1890   (package
1891     (name "java-jettison")
1892     (version "1.3.7")
1893     (source (origin
1894               (method git-fetch)
1895               (uri (git-reference
1896                     (url "https://github.com/codehaus/jettison.git")
1897                     (commit (string-append "jettison-" version))))
1898               (file-name (git-file-name name version))
1899               (sha256
1900                (base32
1901                 "15sydmi5chdh4126qc7v8bsrp7fp4ldaya8a05iby4pq2324q0qw"))))
1902     (build-system ant-build-system)
1903     (arguments
1904      `(#:jar-name "jettison.jar"
1905        #:source-dir "src/main/java"
1906        #:test-exclude (list "**/Abstract*.java"
1907                             ;; Abstract classes
1908                             "**/DOMTest.java"
1909                             "**/BadgerFishDOMTest.java"
1910                             "**/MappedDOMTest.java")))
1911     (native-inputs
1912      `(("java-junit" ,java-junit)))
1913     (home-page "https://github.com/codehaus/jettison")
1914     (synopsis "StAX implementation for JSON")
1915     (description "Jettison is a Java library for converting XML to JSON and
1916 vice-versa with the help of the @dfn{Streaming API for XML} (StAX).  It
1917 implements @code{XMLStreamWriter} and @code{XMLStreamReader} and supports
1918 @code{Mapped} and @code{BadgerFish} conventions.")
1919     (license license:asl2.0)))
1921 (define-public java-jdom2
1922   (package
1923     (name "java-jdom")
1924     (version "2.0.6")
1925     (source (origin
1926               (method git-fetch)
1927               (uri (git-reference
1928                     (url "https://github.com/hunterhacker/jdom.git")
1929                     (commit (string-append "JDOM-" version))))
1930               (file-name (git-file-name name version))
1931               (sha256
1932                (base32
1933                 "14vv1kxrsdvwi4cz3rx6r48w5y6fvk9cymil8qhvxwp56xxrgxiq"))))
1934     (build-system ant-build-system)
1935     (arguments
1936      `(#:build-target "package"
1937        #:tests? #f                ; tests are run as part of the build process
1938        #:phases
1939        (modify-phases %standard-phases
1940          (replace 'install
1941            (install-jars "build")))))
1942     (home-page "http://jdom.org/")
1943     (synopsis "Access, manipulate, and output XML data")
1944     (description "Jdom is a Java-based solution for accessing, manipulating, and
1945 outputting XML data from Java code.")
1946     (license license:bsd-4)))
1948 (define-public java-xstream
1949   (package
1950     (name "java-xstream")
1951     (version "1.4.10")
1952     (source
1953      (origin
1954        (method git-fetch)
1955        (uri (git-reference
1956              (url "https://github.com/x-stream/xstream.git")
1957              (commit (string-append
1958                       "XSTREAM_"
1959                       (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1960                                   version)))))
1961        (file-name (git-file-name name version))
1962        (sha256
1963         (base32 "12m2bw8bapdc1w0pni9wl5hh2y8jfdgcvxd464jl9917dsp3ai2n"))))
1964     (build-system ant-build-system)
1965     (arguments
1966      `(#:jar-name "xstream.jar"
1967        ;; FIXME: Tests are not in a java subdirectory as assumed by ant-build-system.
1968        #:tests? #f
1969        #:jdk ,icedtea-8
1970        #:source-dir "xstream/src/java"))
1971     (inputs
1972      `(("java-jdom" ,java-jdom)
1973        ("java-jdom2" ,java-jdom2)
1974        ("java-cglib" ,java-cglib)
1975        ("java-joda-time" ,java-joda-time)
1976        ("java-jettison" ,java-jettison)
1977        ("java-xom" ,java-xom)
1978        ("java-xpp3" ,java-xpp3)
1979        ("java-dom4j" ,java-dom4j)
1980        ("java-stax2-api" ,java-stax2-api)
1981        ("java-woodstox-core" ,java-woodstox-core)
1982        ("java-kxml2" ,java-kxml2)
1983        ("java-stax" ,java-stax)))
1984     (home-page "https://x-stream.github.io")
1985     (synopsis "XML serialization library")
1986     (description "XStream is a simple library to serialize Java objects to XML
1987 and back again.")
1988     (license license:bsd-3)))
1990 (define-public xmlrpc-c
1991   (package
1992     (name "xmlrpc-c")
1993     (version "1.43.08")
1994     (source (origin
1995              (method url-fetch)
1996              (uri (string-append "mirror://sourceforge/xmlrpc-c/Xmlrpc-c%20Super%20Stable/"
1997                                  version "/xmlrpc-c-" version ".tgz"))
1998              (sha256
1999               (base32
2000                "18zwbj6i2hpcn5riiyp8i6rml0sfv60dd7phw1x8g4r4lj2bbxf9"))))
2001     (build-system gnu-build-system)
2002     (inputs
2003      `(("curl" ,curl)))
2004     (native-inputs
2005      `(;; For tools, if ever needed.
2006        ("perl" ,perl)))
2007     (arguments
2008      `(#:make-flags ; Add $libdir to the RUNPATH of all the executables.
2009        (list (string-append "LDFLAGS_PERSONAL=-Wl,-rpath=" %output "/lib"))
2010        #:phases
2011        (modify-phases %standard-phases
2012          (add-after 'unpack 'fix-/bin/sh-in-tests
2013            (lambda _
2014              (substitute* "GNUmakefile"
2015                (("#! /bin/sh") (which "sh")))
2016              #t)))))
2017     (home-page "http://xmlrpc-c.sourceforge.net/")
2018     (synopsis "Lightweight RPC library based on XML and HTTP")
2019     (description
2020      "XML-RPC is a quick-and-easy way to make procedure calls over the Internet.
2021 It converts the procedure call into an XML document, sends it to a remote
2022 server using HTTP, and gets back the response as XML.  This library provides a
2023 modular implementation of XML-RPC for C and C++.")
2024     (license (list license:psfl license:expat))))
2026 (define-public python-xmltodict
2027   (package
2028     (name "python-xmltodict")
2029     (version "0.11.0")
2030     (source
2031       (origin
2032         (method url-fetch)
2033         (uri (pypi-uri "xmltodict" version))
2034         (sha256
2035           (base32
2036             "1pxh4yjhvmxi1h6f92skv41g4kbsws3ams57150kzn18m907v3cg"))))
2037     (build-system python-build-system)
2038     (native-inputs
2039      `(("python-coverage" ,python-coverage)
2040        ("python-nose" ,python-nose)))
2041     (home-page "https://github.com/martinblech/xmltodict")
2042     (synopsis "Work with XML like you are working with JSON")
2043     (description "This package provides a Python library to convert XML to
2044 @code{OrderedDict}.")
2045     (license license:expat)))