An SWML parser
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config/perl
lib/SWML
t
t_deps
.gitignore
.gitmodules
.travis.yml
Makefile
README.pod

README.pod

NAME

SWML::Parser - An SWML text document parser

SYNOPSIS

use SWML::Parser;
$parser = SWML::Parser->new;
$parser->onerror (sub { ... });
$parser->parse_char_string ($string => $doc);

DESCRIPTION

The SWML::Parser module is an SWML text document parser. SWML is a markup language used in SuikaWiki. The parser converts a string of characters representing an SWML document into a DOM tree.

METHODS

Following methods are available:

$parser = SWML::Parser->new

Creates a new instance of the SWML parser.

$parser->onerror ($code)
$code = $parser->onerror

Get or set the error handler. Note that this version of the SWML parser does not report any error at all.

$parser->parse_char_string ($string, $doc)

Parses a character string and constructs a DOM tree.

The first argument, $string, is a character string to be parsed.

The second argument, $doc is a Document object to which the parsed result is constructed. Any existing child node is removed before parsing.

The Document object must be an instance of DOM Document interface, implementing the manakai DOM Perl Binding specification. Web::DOM::Document is an example of such DOM implementation.

DEPENDENCY

The module requires Perl 5.8 or later.

SPECIFICATION

SWML

SuikaWiki Markup Language (SWML) <http://suika.suikawiki.org/www/markup/suikawiki/spec/swml-work>.

SEE ALSO

The SuikaWiki project <http://suikawiki.org/>.

Web::DOM::Document in the perl-web-dom package <https://github.com/manakai/perl-web-dom>.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2008-2014 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.