Class XML_WBXML_Decoder

Description

From Binary XML Content Format Specification Version 1.3, 25 July 2001 found at http://www.wapforum.org

$Horde: framework/XML_WBXML/WBXML/Decoder.php,v 1.22.10.12 2009/01/06 15:23:50 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /XML_WBXML/WBXML/Decoder.php (line 21)

XML_WBXML_ContentHandler
   |
   --XML_WBXML_Decoder
Variable Summary
Method Summary
 XML_WBXML_Decoder XML_WBXML_Decoder ()
 mixed decode (string $wbxml)
 string decodeToString (string $wbxml)
 void endTag ()
 void entity ( $entity)
 void getAttribute ( $attribute)
 void getAttributes ( $input)
 void getByte (string $input)
 void getCharset ( $input)
 void getCurrentURI ()
 void getDocumentPublicIdentifier ( $input)
 void getDocumentPublicIdentifierImpl ( $dpiType,  $dpiNumber)
 void getStringTableEntry ( $index)
 void getTag ( $tag)
 void getVersionNumber ( $input)
 void parseTag ( $input,  $tag,  $hasAttributes,  $hasContent)
 void retrieveStringTable ( $input)
 void setContentHandler ( &$ch, XML_WBXML_ContentHandler $ch)
 void switchAttributeCodePage ( $codePage)
 void switchElementCodePage ( $codePage)
 void termstr ( $input)
 void writeString ( $str)
 void _decode ( $input)
Variables
mixed $_attributeDTD (line 49)
mixed $_ch (line 43)

Content handler.

Currently just outputs raw XML.

mixed $_dpi (line 32)

Document Public Identifier type

  1. mb_u_int32 well known type
  2. string table
from spec but converted into a string.

Document Public Identifier Used with dpiType.

XML_WBXML_DTDManager $_dtdManager (line 65)

The DTD Manager.

mixed $_error = false (line 58)
mixed $_isAttribute (line 55)
mixed $_isData = false (line 56)
mixed $_prevAttributeDTD (line 47)
mixed $_stringTable = array() (line 37)

String table as defined in 5.7

integer $_strpos (line 72)

The string position.

mixed $_tagDTD (line 45)
mixed $_tagStack = array() (line 54)

State variables.

Inherited Variables

Inherited from XML_WBXML_ContentHandler

XML_WBXML_ContentHandler::$_charset
XML_WBXML_ContentHandler::$_currentUri
XML_WBXML_ContentHandler::$_opaqueHandler
XML_WBXML_ContentHandler::$_output
XML_WBXML_ContentHandler::$_wbxmlVersion
Methods
Constructor XML_WBXML_Decoder (line 77)

Constructor.

XML_WBXML_Decoder XML_WBXML_Decoder ()
decode (line 133)

Takes a WBXML input document and decodes it.

Decoding result is directly passed to the contentHandler. A contenthandler must be set using setContentHandler prior to invocation of this method

  • return: True on success or PEAR_Error.
mixed decode (string $wbxml)
  • string $wbxml: The WBXML document to decode.
decodeToString (line 112)

Takes a WBXML input document and returns decoded XML.

However the preferred and more effecient method is to use decode() rather than decodeToString() and have an appropriate contentHandler deal with the decoded data.

  • return: The decoded XML document.
string decodeToString (string $wbxml)
  • string $wbxml: The WBXML document to decode.
endTag (line 463)
void endTag ()
entity (line 639)

Return the hex version of the base 10 $entity.

void entity ( $entity)
  • $entity
getAttribute (line 619)
void getAttribute ( $attribute)
  • $attribute
getAttributes (line 476)
void getAttributes ( $input)
  • $input
getByte (line 97)

Return one byte from the input stream.

void getByte (string $input)
  • string $input: The WBXML input string.
getCharset (line 227)

Returns the character encoding. Only default character

encodings from J2SE are supported. From http://www.iana.org/assignments/character-sets and http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html

void getCharset ( $input)
  • $input
getCurrentURI (line 599)
void getCurrentURI ()
getDocumentPublicIdentifier (line 200)
void getDocumentPublicIdentifier ( $input)
  • $input
getDocumentPublicIdentifierImpl (line 212)
void getDocumentPublicIdentifierImpl ( $dpiType,  $dpiNumber)
  • $dpiType
  • $dpiNumber
getStringTableEntry (line 249)
void getStringTableEntry ( $index)
  • $index
getTag (line 613)
void getTag ( $tag)
  • $tag
getVersionNumber (line 195)
void getVersionNumber ( $input)
  • $input
parseTag (line 445)
void parseTag ( $input,  $tag,  $hasAttributes,  $hasContent)
  • $input
  • $tag
  • $hasAttributes
  • $hasContent
retrieveStringTable (line 241)

Retrieves the string table.

The string table consists of an mb_u_int32 length and then length bytes forming the table. References to the string table refer to the starting position of the (null terminated) string in this table.

void retrieveStringTable ( $input)
  • $input
setContentHandler (line 88)

Sets the contentHandler that will receive the output of the decoding.

void setContentHandler ( &$ch, XML_WBXML_ContentHandler $ch)
  • XML_WBXML_ContentHandler $ch: The contentHandler
  • &$ch
startGetAttributes (line 589)
void startGetAttributes ()
stopGetAttributes (line 594)
void stopGetAttributes ()
switchAttributeCodePage (line 631)
void switchAttributeCodePage ( $codePage)
  • $codePage
switchElementCodePage (line 625)
void switchElementCodePage ( $codePage)
  • $codePage
termstr (line 647)

Reads a null terminated string.

void termstr ( $input)
  • $input
writeString (line 608)
void writeString ( $str)
  • $str
_decode (line 282)
void _decode ( $input)
  • $input

Inherited Methods

Inherited From XML_WBXML_ContentHandler

 XML_WBXML_ContentHandler::XML_WBXML_ContentHandler()
 XML_WBXML_ContentHandler::characters()
 XML_WBXML_ContentHandler::createSubHandler()
 XML_WBXML_ContentHandler::endElement()
 XML_WBXML_ContentHandler::getCharsetStr()
 XML_WBXML_ContentHandler::getOutput()
 XML_WBXML_ContentHandler::getOutputSize()
 XML_WBXML_ContentHandler::getVersion()
 XML_WBXML_ContentHandler::opaque()
 XML_WBXML_ContentHandler::raiseError()
 XML_WBXML_ContentHandler::removeOpaqueHandler()
 XML_WBXML_ContentHandler::setCharset()
 XML_WBXML_ContentHandler::setOpaqueHandler()
 XML_WBXML_ContentHandler::setVersion()
 XML_WBXML_ContentHandler::startElement()

Documentation generated on Sun, 30 Jan 2011 05:16:42 +0000 by phpDocumentor 1.4.3