To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

From Wikipedia, the free encyclopedia

HaXml is a collection of utilities for parsing, filtering, transforming, and generating XML documents using Haskell.[2]

Overview

HaXml utilities include:[2][3]

HaXml provides a combinator library with a set of higher-order functions which process the XML documents after they are represented using the native Haskell data types.[4] The basic data type is Content which represents the document subset of XML.[5]

HaXml allows to convert XML to Haskell data and vice versa, and it also allows to convert XML to XML (by transforming or filtering). The common usage of the HaXml's parser includes defining the method of traversing the XML data and it has the CFilter type (content filter), where type CFilter = Content -> [Content]. It means that this function defined by the user will take a fragment of an XML data and either return more fragments or none at all. This approach allows to choose XML elements satisfying certain conditions (e.g. tags with certain name or all children of a specified tag).[6][7]

Example

In the chapter 22 "Extended Example: Web Client Programming" of the Real World Haskell by Bryan O'Sullivan, Don Stewart, and John Goerzen, the following example is considered.[6] The XML file looks like this (simplified version):

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version="2.0">
  <channel>
    <title>Haskell Radio</title>
    <link>http://www.example.com/radio/</link>
    <description>Description of this podcast</description>
    <item>First item</item>
    <item>Second item</item>
  </channel>
</rss>

The following content filter is constructed:

channel :: CFilter
channel = tag "rss" /> tag "channel"

This filter is later used to get the title of the channel:

getTitle :: Content -> String
getTitle doc = contentToStringDefault "Untitled Podcast" (channel /> tag "title" /> txt $ doc)

References

  1. ^ "Release v1.25.13". GitHub. Retrieved January 10, 2024.
  2. ^ a b Gajda, Michał J.; Krylov, Dmitry (November 5, 2020). "Fast XML/HTML tools for Haskell: XML TypeLift and improved Xeno". Zenodo. arXiv:2011.03536v1. doi:10.5281/zenodo.3929549. S2CID 226282051.
  3. ^ "README". GitHub. Retrieved January 10, 2024.
  4. ^ Shin-Cheng Mu; Zhenjiang Hu; Masato Takeichi. "Bidirectionalising HaXML" (PDF). Archived from the original (PDF) on January 10, 2024. Retrieved January 10, 2024.
  5. ^ Ohlendorf, Manuel (January 6, 2007). "A Cookbook for the Haskell XML Toolbox with Examples for Processing RDF Documents" (PDF). fhwedel Computer Science Department. p. 78. Archived (PDF) from the original on January 13, 2024. Retrieved January 13, 2024.
  6. ^ a b O'Sullivan, Bryan; Goerzen, John; Stewart, Don (2008). "Chapter 22. Extended Example: Web Client Programming". Real World Haskell. O'Reilly Media. ISBN 978-0596514983.
  7. ^ Wallace, Malcolm; Runciman, Colin (September 1, 1999). "Haskell and XML: generic combinators or type-based translation?" (PDF). ACM SIGPLAN Notices. 34 (9): 148–159. doi:10.1145/317765.317794.

External links

This page was last edited on 4 February 2024, at 05:42
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.