com.caucho.quercus.lib.xml
Class XmlModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.xml.XmlModule
All Implemented Interfaces:
QuercusModule

public class XmlModule
extends AbstractQuercusModule

PHP XML


Field Summary
static int XML_ERROR_ABORTED
           
static int XML_ERROR_ASYNC_ENTITY
           
static int XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
           
static int XML_ERROR_BAD_CHAR_REF
           
static int XML_ERROR_BINARY_ENTITY_REF
           
static int XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
           
static int XML_ERROR_DUPLICATE_ATTRIBUTE
           
static int XML_ERROR_ENTITY_DECLARED_IN_PE
           
static int XML_ERROR_EXTERNAL_ENTITY_HANDLING
           
static int XML_ERROR_FEATURE_REQUIRES_XML_DTD
           
static int XML_ERROR_FINISHED
           
static int XML_ERROR_INCOMPLETE_PE
           
static int XML_ERROR_INCORRECT_ENCODING
           
static int XML_ERROR_INVALID_TOKEN
           
static int XML_ERROR_JUNK_AFTER_DOC_ELEMENT
           
static int XML_ERROR_MISPLACED_XML_PI
           
static int XML_ERROR_NO_ELEMENTS
           
static int XML_ERROR_NO_MEMORY
           
static int XML_ERROR_NONE
           
static int XML_ERROR_NOT_STANDALONE
           
static int XML_ERROR_NOT_SUSPENDED
           
static int XML_ERROR_PARAM_ENTITY_REF
           
static int XML_ERROR_PARTIAL_CHAR
           
static int XML_ERROR_PUBLICID
           
static int XML_ERROR_RECURSIVE_ENTITY_REF
           
static int XML_ERROR_SUSPEND_PE
           
static int XML_ERROR_SUSPENDED
           
static int XML_ERROR_SYNTAX
           
static int XML_ERROR_TAG_MISMATCH
           
static int XML_ERROR_TEXT_DECL
           
static int XML_ERROR_UNBOUND_PREFIX
           
static int XML_ERROR_UNCLOSED_CDATA_SECTION
           
static int XML_ERROR_UNCLOSED_TOKEN
           
static int XML_ERROR_UNDECLARING_PREFIX
           
static int XML_ERROR_UNDEFINED_ENTITY
           
static int XML_ERROR_UNEXPECTED_STATE
           
static int XML_ERROR_UNKNOWN_ENCODING
           
static int XML_ERROR_XML_DECL
           
static int XML_OPTION_CASE_FOLDING
           
static int XML_OPTION_SKIP_TAGSTART
           
static int XML_OPTION_SKIP_WHITE
           
static int XML_OPTION_TARGET_ENCODING
           
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
XmlModule()
           
 
Method Summary
 java.lang.String[] getLoadedExtensions()
          Returns the extensions loaded by the module.
static Value utf8_decode(Env env, StringValue str)
          Converts from utf8 to iso-8859-1
static Value utf8_encode(Env env, StringValue str)
          Converts from iso-8859-1 to utf8
 Value xml_error_string(int code)
          Returns the error string for xml parser
 Value xml_get_current_byte_index(Xml parser)
          Returns the parser's byte
 Value xml_get_current_column_number(Xml parser)
          Returns the parser's column
 Value xml_get_current_line_number(Xml parser)
          Returns the parser's line
 Value xml_get_error_code(Xml parser)
          Returns the error code for xml parser
 int xml_parse_into_struct(Env env, Xml parser, StringValue data, Value valueArray, Value indexArray)
           
 int xml_parse(Env env, Xml parser, StringValue data, boolean isFinal)
           
 Xml xml_parser_create_ns(Env env, java.lang.String outputEncoding, java.lang.String separator)
          XXX: Should we return warning if separator is anything but ":"???
 Xml xml_parser_create(Env env, java.lang.String outputEncoding)
          returns a new Xml Parser
 boolean xml_parser_free(Xml parser)
          stub function.
 Value xml_parser_get_option(Xml parser, int option)
           
 boolean xml_parser_set_option(Xml parser, int option, Value value)
           
 boolean xml_set_character_data_handler(Xml parser, Value handler)
           
 boolean xml_set_default_handler(Xml parser, Value handler)
           
 boolean xml_set_element_handler(Xml parser, Value startElementHandler, Value endElementHandler)
           
 boolean xml_set_end_namespace_decl_handler(Xml parser, Value handler)
           
 boolean xml_set_notation_decl_handler(Xml parser, Value handler)
           
 boolean xml_set_object(Xml parser, Value obj)
           
 boolean xml_set_processing_instruction_handler(Xml parser, Value handler)
           
 boolean xml_set_start_namespace_decl_handler(Xml parser, Value startNamespaceDeclHandler)
           
 boolean xml_set_unparsed_entity_decl_handler(Xml parser, Value handler)
           
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
getConstMap, getIniDefinitions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_OPTION_CASE_FOLDING

public static final int XML_OPTION_CASE_FOLDING
See Also:
Constant Field Values

XML_OPTION_SKIP_TAGSTART

public static final int XML_OPTION_SKIP_TAGSTART
See Also:
Constant Field Values

XML_OPTION_SKIP_WHITE

public static final int XML_OPTION_SKIP_WHITE
See Also:
Constant Field Values

XML_OPTION_TARGET_ENCODING

public static final int XML_OPTION_TARGET_ENCODING
See Also:
Constant Field Values

XML_ERROR_NONE

public static final int XML_ERROR_NONE
See Also:
Constant Field Values

XML_ERROR_NO_MEMORY

public static final int XML_ERROR_NO_MEMORY
See Also:
Constant Field Values

XML_ERROR_SYNTAX

public static final int XML_ERROR_SYNTAX
See Also:
Constant Field Values

XML_ERROR_NO_ELEMENTS

public static final int XML_ERROR_NO_ELEMENTS
See Also:
Constant Field Values

XML_ERROR_INVALID_TOKEN

public static final int XML_ERROR_INVALID_TOKEN
See Also:
Constant Field Values

XML_ERROR_UNCLOSED_TOKEN

public static final int XML_ERROR_UNCLOSED_TOKEN
See Also:
Constant Field Values

XML_ERROR_PARTIAL_CHAR

public static final int XML_ERROR_PARTIAL_CHAR
See Also:
Constant Field Values

XML_ERROR_TAG_MISMATCH

public static final int XML_ERROR_TAG_MISMATCH
See Also:
Constant Field Values

XML_ERROR_DUPLICATE_ATTRIBUTE

public static final int XML_ERROR_DUPLICATE_ATTRIBUTE
See Also:
Constant Field Values

XML_ERROR_JUNK_AFTER_DOC_ELEMENT

public static final int XML_ERROR_JUNK_AFTER_DOC_ELEMENT
See Also:
Constant Field Values

XML_ERROR_PARAM_ENTITY_REF

public static final int XML_ERROR_PARAM_ENTITY_REF
See Also:
Constant Field Values

XML_ERROR_UNDEFINED_ENTITY

public static final int XML_ERROR_UNDEFINED_ENTITY
See Also:
Constant Field Values

XML_ERROR_RECURSIVE_ENTITY_REF

public static final int XML_ERROR_RECURSIVE_ENTITY_REF
See Also:
Constant Field Values

XML_ERROR_ASYNC_ENTITY

public static final int XML_ERROR_ASYNC_ENTITY
See Also:
Constant Field Values

XML_ERROR_BAD_CHAR_REF

public static final int XML_ERROR_BAD_CHAR_REF
See Also:
Constant Field Values

XML_ERROR_BINARY_ENTITY_REF

public static final int XML_ERROR_BINARY_ENTITY_REF
See Also:
Constant Field Values

XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF

public static final int XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
See Also:
Constant Field Values

XML_ERROR_MISPLACED_XML_PI

public static final int XML_ERROR_MISPLACED_XML_PI
See Also:
Constant Field Values

XML_ERROR_UNKNOWN_ENCODING

public static final int XML_ERROR_UNKNOWN_ENCODING
See Also:
Constant Field Values

XML_ERROR_INCORRECT_ENCODING

public static final int XML_ERROR_INCORRECT_ENCODING
See Also:
Constant Field Values

XML_ERROR_UNCLOSED_CDATA_SECTION

public static final int XML_ERROR_UNCLOSED_CDATA_SECTION
See Also:
Constant Field Values

XML_ERROR_EXTERNAL_ENTITY_HANDLING

public static final int XML_ERROR_EXTERNAL_ENTITY_HANDLING
See Also:
Constant Field Values

XML_ERROR_NOT_STANDALONE

public static final int XML_ERROR_NOT_STANDALONE
See Also:
Constant Field Values

XML_ERROR_UNEXPECTED_STATE

public static final int XML_ERROR_UNEXPECTED_STATE
See Also:
Constant Field Values

XML_ERROR_ENTITY_DECLARED_IN_PE

public static final int XML_ERROR_ENTITY_DECLARED_IN_PE
See Also:
Constant Field Values

XML_ERROR_FEATURE_REQUIRES_XML_DTD

public static final int XML_ERROR_FEATURE_REQUIRES_XML_DTD
See Also:
Constant Field Values

XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING

public static final int XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
See Also:
Constant Field Values

XML_ERROR_UNBOUND_PREFIX

public static final int XML_ERROR_UNBOUND_PREFIX
See Also:
Constant Field Values

XML_ERROR_UNDECLARING_PREFIX

public static final int XML_ERROR_UNDECLARING_PREFIX
See Also:
Constant Field Values

XML_ERROR_INCOMPLETE_PE

public static final int XML_ERROR_INCOMPLETE_PE
See Also:
Constant Field Values

XML_ERROR_XML_DECL

public static final int XML_ERROR_XML_DECL
See Also:
Constant Field Values

XML_ERROR_TEXT_DECL

public static final int XML_ERROR_TEXT_DECL
See Also:
Constant Field Values

XML_ERROR_PUBLICID

public static final int XML_ERROR_PUBLICID
See Also:
Constant Field Values

XML_ERROR_SUSPENDED

public static final int XML_ERROR_SUSPENDED
See Also:
Constant Field Values

XML_ERROR_NOT_SUSPENDED

public static final int XML_ERROR_NOT_SUSPENDED
See Also:
Constant Field Values

XML_ERROR_ABORTED

public static final int XML_ERROR_ABORTED
See Also:
Constant Field Values

XML_ERROR_FINISHED

public static final int XML_ERROR_FINISHED
See Also:
Constant Field Values

XML_ERROR_SUSPEND_PE

public static final int XML_ERROR_SUSPEND_PE
See Also:
Constant Field Values
Constructor Detail

XmlModule

public XmlModule()
Method Detail

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Description copied from class: AbstractQuercusModule
Returns the extensions loaded by the module.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

utf8_encode

public static Value utf8_encode(Env env,
                                StringValue str)
Converts from iso-8859-1 to utf8


utf8_decode

public static Value utf8_decode(Env env,
                                StringValue str)
Converts from utf8 to iso-8859-1


xml_get_current_byte_index

public Value xml_get_current_byte_index(Xml parser)
Returns the parser's byte


xml_get_current_line_number

public Value xml_get_current_line_number(Xml parser)
Returns the parser's line


xml_get_current_column_number

public Value xml_get_current_column_number(Xml parser)
Returns the parser's column


xml_get_error_code

public Value xml_get_error_code(Xml parser)
Returns the error code for xml parser


xml_error_string

public Value xml_error_string(int code)
Returns the error string for xml parser


xml_parse

public int xml_parse(Env env,
                     Xml parser,
                     StringValue data,
                     boolean isFinal)
Parameters:
parser -
data -
isFinal -
Returns:
false if parser == null
Throws:
java.lang.Exception
See Also:
Xml.xml_parse

xml_parser_create

public Xml xml_parser_create(Env env,
                             java.lang.String outputEncoding)
returns a new Xml Parser


xml_parser_create_ns

public Xml xml_parser_create_ns(Env env,
                                java.lang.String outputEncoding,
                                java.lang.String separator)
XXX: Should we return warning if separator is anything but ":"???

Parameters:
env -
outputEncoding -
separator -
Returns:
namespace aware Xml Parser

xml_parser_set_option

public boolean xml_parser_set_option(Xml parser,
                                     int option,
                                     Value value)
Parameters:
parser -
option -
value -
Returns:
false if parser == null
See Also:
Xml.xml_parser_set_option

xml_parser_get_option

public Value xml_parser_get_option(Xml parser,
                                   int option)
Parameters:
parser -
option -
Returns:
false if parser == null
See Also:
Xml.xml_parser_get_option

xml_set_element_handler

public boolean xml_set_element_handler(Xml parser,
                                       Value startElementHandler,
                                       Value endElementHandler)
Parameters:
parser -
startElementHandler -
endElementHandler -
Returns:
false if parser == null
See Also:
Xml.xml_set_element_handler

xml_set_character_data_handler

public boolean xml_set_character_data_handler(Xml parser,
                                              Value handler)
Parameters:
parser -
handler -
Returns:
false if parser == null
See Also:
Xml.xml_set_character_data_handler

xml_set_start_namespace_decl_handler

public boolean xml_set_start_namespace_decl_handler(Xml parser,
                                                    Value startNamespaceDeclHandler)
Parameters:
parser -
startNamespaceDeclHandler -
Returns:
false if parser == null
See Also:
Xml.xml_set_start_namespace_decl_handler

xml_set_object

public boolean xml_set_object(Xml parser,
                              Value obj)
Parameters:
parser -
obj -
Returns:
false if parser == null

xml_set_processing_instruction_handler

public boolean xml_set_processing_instruction_handler(Xml parser,
                                                      Value handler)
Parameters:
parser -
handler -
Returns:
false if parser == null

xml_set_default_handler

public boolean xml_set_default_handler(Xml parser,
                                       Value handler)
Parameters:
parser -
handler -
Returns:
false if parser == null

xml_set_notation_decl_handler

public boolean xml_set_notation_decl_handler(Xml parser,
                                             Value handler)
Parameters:
parser -
handler -
Returns:
false is parser == null
See Also:
Xml.xml_set_notation_decl_handler

xml_set_end_namespace_decl_handler

public boolean xml_set_end_namespace_decl_handler(Xml parser,
                                                  Value handler)
Parameters:
parser -
handler -
Returns:
false if parser == null

xml_parse_into_struct

public int xml_parse_into_struct(Env env,
                                 Xml parser,
                                 StringValue data,
                                 Value valueArray,
                                 Value indexArray)
Parameters:
parser -
data -
valueArray -
indexArray -
Returns:
false if parser == null
Throws:
java.lang.Exception

xml_parser_free

public boolean xml_parser_free(Xml parser)
stub function. parser_free taken care of by garbage collection

Parameters:
parser -
Returns:
false if parser == null, otherwise true

xml_set_unparsed_entity_decl_handler

public boolean xml_set_unparsed_entity_decl_handler(Xml parser,
                                                    Value handler)
Parameters:
parser -
handler -
Returns:
false if parser == null, otherwise true
See Also:
Xml.xml_set_unparsed_entity_decl_handler