WAP::SAXDriver::wbxml - SAX parser for WBXML file
use WAP::SAXDriver::wbxml; $parser = WAP::SAXDriver::wbxml->new( [OPTIONS] ); $result = $parser->parse( [OPTIONS] );
WAP::SAXDriver::wbxml is a SAX2 driver, and it inherits of XML::SAX::Base. This man page summarizes the specific options, handlers, and properties supported by WAP::SAXDriver::wbxml; please refer to the SAX 2.0 standard for general usage information.
WAP::SAXDriver::wbxml
A WBXML file is the binarized form of XML file according the specification :
WAP - Wireless Application Protocol / Binary XML Content Format Specification / Version 1.3 WBXML (15th May 2000 Approved)
This module could be parametrized by the file WAP::SAXDriver::wbrules.pl what contains all specific values used by WAP applications.
WAP::SAXDriver::wbrules.pl
This module needs IO::File, IO::String and I18N::Charset modules.
Creates a new parser object. Default options for parsing, described below, are passed as key-value pairs or as a single hash. Options may be changed directly in the parser object unless stated otherwise. Options passed to `parse()' override the default options in the parser object for the duration of the parse.
parse()
Parses a document. Options, described below, are passed as key-value pairs or as a single hash. Options passed to `parse()' override default options in the parser object.
These are all convenience variations on parse(), and in fact simply set up the options before calling it.
Returns the location as a hash:
BytePosition The current byte position of the parse. ColumnNumber The column number of the parse, equals to BytePosition. LineNumber The line number of the parse, always equals to 1. PublicId A string containing the public identifier, or undef if none is available.
The following options are supported by WAP::SAXDriver::wbxml :
Handler default handler to receive events DocumentHandler handler to receive document events DTDHandler handler to receive DTD events ErrorHandler handler to receive error events Source hash containing the input source for parsing UseOnlyDefaultRules boolean, if true the file wap.wbrules2.pl is not loaded RulesPath path of alternate rules (standard is WAP/SAXDriver/wap.wbrules2.pl)
If no handlers are provided then all events will be silently ignored, except for `fatal_error()' which will cause a `die()' to be called after calling `end_document()'.
fatal_error()
die()
end_document()
The `Source' hash may contain the following parameters:
Source
ByteStream The raw byte stream (file handle) containing the document. String A string containing the document. Encoding A string describing the character encoding.
If more than one of `ByteStream', or `String', then preference is given first to `ByteStream', then `String'.
ByteStream
String
The following handlers and properties are supported by WAP::SAXDriver::wbxml :
Receive notification of the beginning of a document.
Version The XML version, always 1.0. Encoding The encoding string, if any. Standalone undefined. VersionWBXML The version used for the binarization.
Receive notification of the end of a document.
No properties defined.
Receive notification of the beginning of an element.
Name The element type name. Attributes A hash containing the attributes attached to the element, if any.
The `Attributes' hash contains only string values.
Attributes
Receive notification of the end of an element.
Name The element type name.
Receive notification of character data.
Data The characters from the XML document.
Receive notification of a processing instruction.
Target The processing instruction target. Data The processing instruction data, if any.
Receive notification of a warning event.
Message The detailed explanation. BytePosition The current byte position of the parse. ColumnNumber The column number of the parse, equals to BytePosition. LineNumber The line number of the parse, always equals to 1. PublicId A string containing the public identifier, or undef if none is available.
Receive notification of an error event.
Receive notification of a fatal error event.
Receive notification of the beginning of a DTD
Name The document type name PublicId The declared public identifier for the external DTD SystemId The declared system identifier for the external DTD (may be wrong)
Receive notification of the end of a DTD.
Deprecated in favour of start_document.
Receive notification of a XML declaration event.
(c) 2002-2007 Francois PERRAD, France.
This program is distributed under the terms of the Artistic Licence.
The WAP Specifications are copyrighted by the Wireless Application Protocol Forum Ltd. See <http://www.wapforum.org/what/copyright.htm>.
Francois PERRAD, francois.perrad@gadz.org
XML::SAX, XML::SAX::Base, WAP::wbxml
Extensible Markup Language (XML) http://www.w3c.org/XML/ Binary XML Content Format (WBXML) http://www.wapforum.org/ Simple API for XML (SAX) http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/perl-xml/libxml-perl/doc/sax-2.0.html?rev=HEAD&content-type=text/html
To install WAP::SAXDriver::wbxml, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WAP::SAXDriver::wbxml
CPAN shell
perl -MCPAN -e shell install WAP::SAXDriver::wbxml
For more information on module installation, please visit the detailed CPAN module installation guide.