Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Very Simple XML Reader forked from valadoc
Vala
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
LICENSE
Makefile
README.md
Sxml-0.1.pc

README.md

simple-xml-reader-vala

Very Simple XML Reader forked from valadoc

    make
    make install

Example

This example outputs the complete xml on the console

using Sxml;

public class Sxml.Example : DataReader, Object {
    protected MarkupTokenType current_token {get; set;}
    protected MarkupSourceLocation begin {get; set;}
    protected MarkupSourceLocation end {get; set;}
    protected XmlStreamReader reader {get; set;}
    public string path { get; construct set; }

    public Example (string path, string filename) {
        reader = new XmlStreamReader (path+filename);
    }
    public void parse() {
        next();
        while (current_token != MarkupTokenType.EOF) {
            next();
            if(reader.name != "tile") {
                print(@"$current_token, name: %s, content: %s\n",reader.name, reader.content);
                reader.print_attributes();
            }
        }
    }
}

void main () {
    Example xml = new Example("test/","testmap.tmx");
    xml.parse();
}

Compile

valac --pkg gee-1.0 --pkg Sxml-0.1 example.vala -o example.o
./example.o

Applied examples

Lizenz

GNU GPL v2

Something went wrong with that request. Please try again.