NAME

WAP::SAXDriver::wbxml - SAX parser for WBXML file

SYNOPSIS

use WAP::SAXDriver::wbxml;

$parser = WAP::SAXDriver::wbxml->new( [OPTIONS] );
$result = $parser->parse( [OPTIONS] );

DESCRIPTION

WAP::SAXDriver::wbxml is a PerlSAX parser. This man page summarizes the specific options, handlers, and properties supported by WAP::SAXDriver::wbxml; please refer to the PerlSAX standard in `PerlSAX.pod' for general usage information.

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.

METHODS

new

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.

location

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.

OPTIONS

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 wbrules.pl is not loaded

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()'.

The `Source' hash may contain the following parameters:

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'.

HANDLERS

The following handlers and properties are supported by WAP::SAXDriver::wbxml :

DocumentHandler methods

start_document

Receive notification of the beginning of a document.

No properties defined.

end_document

Receive notification of the end of a document.

No properties defined.

start_element

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.

end_element

Receive notification of the end of an element.

Name             The element type name.
characters

Receive notification of character data.

Data             The characters from the XML document.
processing_instruction

Receive notification of a processing instruction.

Target           The processing instruction target.
Data             The processing instruction data, if any.

DTDHandler methods

xml_decl

Receive notification of an XML declaration event.

Version          The XML version, always 1.0.
Encoding         The encoding string, if any.
Standalone       undefined.
VersionWBXML     The version used for the binarization.
PublicId         The document's public identifier.

ErrorHandler methods

warning

Receive notification of an 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.
error

Receive notification of an error 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.
fatal_error

Receive notification of an fatal error event.

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.

COPYRIGHT

(c) 2002 Francois PERRAD, France. All rights reserved.

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>.

AUTHOR

Francois PERRAD, <perrad@besancon.sema.slb.com>

SEE ALSO

perl(1), PerlSAX.pod(3), 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://www.saxproject.org/>