com.caucho.quercus.lib.xml
Class Xml

java.lang.Object
  extended by com.caucho.quercus.lib.xml.Xml

public class Xml
extends java.lang.Object

XML object oriented API facade


Constructor Summary
Xml(Env env, java.lang.String outputEncoding, java.lang.String separator)
           
 
Method Summary
 int getByteIndex()
           
 int getColumn()
           
 int getErrorCode()
           
 java.lang.String getErrorString()
           
 int getLine()
           
 java.lang.String toString()
           
 int xml_parse_into_struct(Env env, StringValue data, Value valsV, Value indexV)
          Parses data into 2 parallel array structures.
 int xml_parse(Env env, StringValue data, boolean isFinal)
          xml_parse will keep accumulating "data" until either is_final is true or omitted
 Value xml_parser_get_option(Env env, int option)
           
 boolean xml_parser_set_option(int option, Value value)
          sets one of the following: _xmlOptionCaseFolding (ENABLED / DISABLED) _xmlOptionTargetEncoding (String) _xmlOptionSkipTagstart (int) _xmlOptionSkipWhite (ENABLED / DISABLED) XXX: currently only _xmlOptionCaseFolding actually does something
 boolean xml_set_character_data_handler(Env env, Value handler)
          Sets the character data handler function.
 boolean xml_set_default_handler(Env env, Value handler)
          The php documentation is very vague as to the purpose of the default handler.
 boolean xml_set_element_handler(Env env, Value startElementHandler, Value endElementHandler)
          Sets the element handler functions for the XML parser.
 boolean xml_set_end_namespace_decl_handler(Env env, Value endNamespaceDeclHandler)
          Sets the endPrefixMapping handler
 boolean xml_set_notation_decl_handler(Env env, Value handler)
          Sets the notationDecl handler
 boolean xml_set_object(Value obj)
          sets the object which houses all the callback functions
 boolean xml_set_processing_instruction_handler(Env env, Value processingInstructionHandler)
          Sets the processing instruction handler function
 boolean xml_set_start_namespace_decl_handler(Env env, Value startNamespaceDeclHandler)
          Sets the startPrefixMapping handler
 boolean xml_set_unparsed_entity_decl_handler(Env env, Value handler)
          Sets the unparsedEntityDecl handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xml

public Xml(Env env,
           java.lang.String outputEncoding,
           java.lang.String separator)
Method Detail

getLine

public int getLine()

getColumn

public int getColumn()

getByteIndex

public int getByteIndex()

getErrorCode

public int getErrorCode()

getErrorString

public java.lang.String getErrorString()

xml_set_element_handler

public boolean xml_set_element_handler(Env env,
                                       Value startElementHandler,
                                       Value endElementHandler)
Sets the element handler functions for the XML parser.

Parameters:
startElementHandler - must exist when xml_parse is called
endElementHandler - must exist when xml_parse is called
Returns:
true always even if handlers are disabled

xml_set_character_data_handler

public boolean xml_set_character_data_handler(Env env,
                                              Value handler)
Sets the character data handler function.

Parameters:
handler - can be empty string or FALSE
Returns:
true always even if handler is disabled

xml_set_default_handler

public boolean xml_set_default_handler(Env env,
                                       Value handler)
The php documentation is very vague as to the purpose of the default handler. We are interpreting it as an alternative to the character data handler. If character handler is defined, then use that. Otherwise, use default handler, if it is defined. XXX: Need to confirm that this is appropriate

Parameters:
handler -
Returns:
true always even if handler is disabled

xml_set_processing_instruction_handler

public boolean xml_set_processing_instruction_handler(Env env,
                                                      Value processingInstructionHandler)
Sets the processing instruction handler function

Parameters:
processingInstructionHandler -
Returns:
true always even if handler is disabled

xml_set_start_namespace_decl_handler

public boolean xml_set_start_namespace_decl_handler(Env env,
                                                    Value startNamespaceDeclHandler)
Sets the startPrefixMapping handler

Parameters:
startNamespaceDeclHandler -
Returns:
true always even if handler is disabled

xml_set_unparsed_entity_decl_handler

public boolean xml_set_unparsed_entity_decl_handler(Env env,
                                                    Value handler)
Sets the unparsedEntityDecl handler

Parameters:
handler -
Returns:
true always even if handler is disabled

xml_set_end_namespace_decl_handler

public boolean xml_set_end_namespace_decl_handler(Env env,
                                                  Value endNamespaceDeclHandler)
Sets the endPrefixMapping handler

Parameters:
endNamespaceDeclHandler -
Returns:
true always even if handler is disabled

xml_set_notation_decl_handler

public boolean xml_set_notation_decl_handler(Env env,
                                             Value handler)
Sets the notationDecl handler

Parameters:
handler -
Returns:
true always even if handler is disabled

xml_set_object

public boolean xml_set_object(Value obj)
sets the object which houses all the callback functions

Parameters:
obj -
Returns:
returns true unless obj == null

xml_parse

public int xml_parse(Env env,
                     StringValue data,
                     boolean isFinal)
              throws java.lang.Exception
xml_parse will keep accumulating "data" until either is_final is true or omitted

Parameters:
data -
isFinal -
Returns:
Throws:
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.lang.Exception

xml_parse_into_struct

public int xml_parse_into_struct(Env env,
                                 StringValue data,
                                 Value valsV,
                                 Value indexV)
                          throws java.lang.Exception
Parses data into 2 parallel array structures.

Parameters:
data -
valsV -
indexV -
Returns:
0 for failure, 1 for success
Throws:
java.lang.Exception

xml_parser_set_option

public boolean xml_parser_set_option(int option,
                                     Value value)
sets one of the following: _xmlOptionCaseFolding (ENABLED / DISABLED) _xmlOptionTargetEncoding (String) _xmlOptionSkipTagstart (int) _xmlOptionSkipWhite (ENABLED / DISABLED) XXX: currently only _xmlOptionCaseFolding actually does something

Parameters:
option -
value -
Returns:
true unless value could not be set

xml_parser_get_option

public Value xml_parser_get_option(Env env,
                                   int option)
Parameters:
option -
Returns:
relevant value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object