summaryrefslogtreecommitdiff
path: root/README.md
blob: 5d7fd47efe647fe02795ff36602181f0a2ac7191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
xml2tsv
=======

This is a simple xml-to-tsv converter written in C and based on the
xmlparser library by Hiltjo Posthuma.

The filter reads an XML file from stdin and writes a
tab-separated-values file on stdout. For instance, the XML content
below:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <!-- FOR THE CURIOUS: This site was made by @thebarrytone. Don't tell my mom. -->
        
        <title>Motherfucking Website</title>
    </head>
    
    <body>
        <header>
            <h1>This is a motherfucking website.</h1>
            <aside>And it's fucking perfect.</aside>
        </header>
    </body>
    </html>

is transformed in the following lines:

    /html
    /html/head          
    /html/head/meta charset=utf-8
    /html/head          
    /html/head/meta name=viewport   content=width=device-width, initial-scale=1
    /html/head          \n              \n    
    /html/head/title        Motherfucking Website
    /html/body          
    /html/body/header               
    /html/body/header/h1    This is a motherfucking website.                
    /html/body/header/aside And it's fucking perfect.                

Customisation
=============

It is possible to customise several aspects of the output by changing
values in `config.h`. Please see the comments within that file for more
details.

Copying
=======

`xml2tsv` is (c) 2020 by Vincenzo "KatolaZ" Nicosia. It can be used,
distributed, modified, and redistributed under the terms of the ISC
License. See the file LICENSE for more details.