Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

The start argument must name a function you've created that takes three arguments.
The first function is the parser identifier. The second is the name of the start tag found.
The third is an array of the attributes for the start tag. The indices of this array are the
attribute names. The elements are in the same order as they appeared in the XML.


The second function handles end tags. It takes two arguments, the first of which is the
parser identifier. The other is the name of the tag.


boolean xml_set_external_entity_ref_handler(integer parser,
string function)


XML entities follow the form of HTML entities. They start with an ampersand and end
with a semicolon. Between these two characters is the name of the entity. An external
entity is defined in another file. This takes the form <!ENTITY externalEntity
SYSTEM "entities.xml"> in your XML file. Each time the entity appears in the
body of the XML file, the handler you specify in
xml_set_external_entity_ref_handler is called.


The handler function must take five arguments. First is the parser identifier. Next is a
string containing the names of the entities open for this parser. Then come the base, the
system ID, and the public ID.


boolean xml_set_notation_decl_handler(integer parser, string
function)


The handler registered with xml_set_notation_decl_handler receives notation
declarations. This are formed like <!NOTATION jpg SYSTEM
"/usr/local/bin/jview"> and are meant to suggest a program for handling a
data type.


The handler must take five arguments, the first of which is the parser identifier. The
second is the name of the notation entity. The rest are base, system ID, and public ID, in
that order.


boolean xml_set_processing_instruction_handler(integer
parser, string function)


The xml_set_processing_instruction_handler function registers the
function that handles tags of the following form: <?target data?>. This may be
familiar; it's how PHP code is embedded in files. The target keyword identifies the
type of data inside the tag. Everything else is data.


The function argument must specify a function that takes three arguments. The first is
the parser identifier. The second is the target. The third is the data.

Free download pdf