summaryrefslogtreecommitdiff
path: root/examples/filter.cpp
blob: 48d0a6aab94eb1044ea00ded8d80153bbd2cac94 (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
#include <file.hpp>
#include <xift.hpp>


int main()
{
    XiftFile exporter(stdout);
    Xift     xift(exporter);

    xift.Tag("a").Attribute("href");
    XiftTag &p = xift.Tag("p");
    p.Attribute("class");
    p.Attribute("hidden");
    p.Attribute("id");
    xift.Tag("script");

    xift.Remove("script");
    p.Remove("id");

    xift.PutFile("message.html");

    if (!xift.End()) {
        printf("Error on %d line, %d column:\n%s",
               xift.ErrorLine(), xift.ErrorColumn(),
               xift_error_message(xift.GetError()));
    }

    return 0;
}