Parse::WBXML - event-driven support for the generation and parsing of WBXML documents
version 0.005
use Parse::WBXML; my $wbxml = Parse::WBXML->new; $wbxml->add_handler_for_event( start_element => sub { my ($self, $el) = @_; $self; }, characters => sub { my ($self, $data) = @_; $self; }, end_element => sub { my ($self, $el) = @_; $self; }, ); $wbxml->parse("wbxml data");
WARNING: this is an early alpha release, if you want WBXML support then please try the other modules in "SEE ALSO" first. The current API may change before the 1.0 release.
Provides a pure-Perl implementation for the WBXML compressed XML format. Slower and less efficient than the libwbxml2-based alternatives ("SEE ALSO"), but supports streaming SAX-like parsing.
This may be of some use in low-bandwidth situations where you want data as soon as available from the stream, or in cases where the document is damaged and you want to recover as much data as possible, or if you just don't have libwbxml2 available.
Returns the current charset, such as 'UTF-8'.
Returns the current public ID, which is the XML DTD identifier for this document, e.g. "-//WAPFORUM//DTD SI 1.0//EN".
Returns current version as a string, e.g. "1.3".
Returns current attribute codepage. This is the table used for all document-specific attribute tag lookups, and defaults to 0.
Returns current tag codepage. This is the table used for all document-specific element tag lookups, and defaults to 0.
Constructor. Ignores everything you give it.
Convert multi-byte sequence to an integer value.
Decodes the given string using the current "charset".
Encodes the given string using the current "charset".
Parse as much as we can from the given buffer.
Takes a single scalar ref as parameter, this should point to the buffer to be processed.
Queue the initial items for parsing.
Process everything we can in the queue.
Return current item in the queue (without removing it).
Remove the current item from the queue.
Queue some more items. More of a shift than a push.
Parse the given item if we have a method for it.
Deconstruct a version - single byte containing major in the high nybble, minor in the lower nybble.
Look up the given public ID, which is either a token for a preset value or a reference to the string table.
Given a buffer of data, will report as much information as we can extract.
Extracts the next tag code from the buffer, returning an empty list if none found.
Get tag Process attibutes if any Process content if any
Probably more suited to Marpa::XS-style parsing than a manual task stack/state machine, so it's likely that the internals will be rearranged in the next version(s).
XML::WBXML - wrapper around libwbxml2, faster and more robust than this module
WAP::SAXDriver::wbxml - provides SAX events from WBXML sources
WAP::wbxml - generic support for converting to/from WBXML
CGI::WML - also contains an XML-to-WBXML compiler
Open Mobile Alliance documentation at http://www.openmobilealliance.org/tech/affiliates/syncml/syncmlindex.html
Tom Molesworth <cpan@entitymodel.com>
Copyright Tom Molesworth 2011-2012. Licensed under the same terms as Perl itself.
To install Parse::WBXML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::WBXML
CPAN shell
perl -MCPAN -e shell install Parse::WBXML
For more information on module installation, please visit the detailed CPAN module installation guide.