XML_PARSE(3) 1 XML_PARSE(3)xml_parse - Start parsing an XML documentSYNOPSIS
int xml_parse (resource $parser, string $data, [bool $is_final = false])
DESCRIPTION xml_parse(3) parses an XML document. The handlers for the configured events are called as many times as necessary.
PARAMETERS
o $parser
- A reference to the XML parser to use.
o $data
- Chunk of data to parse. A document may be parsed piece-wise by calling xml_parse(3) several times with new data, as long as the
$is_final parameter is set and TRUE when the last data is parsed.
o $is_final
- If set and TRUE, $data is the last piece of data sent in this parse.
RETURN VALUES
Returns 1 on success or 0 on failure.
For unsuccessful parses, error information can be retrieved with xml_get_error_code(3), xml_error_string(3), xml_get_current_line_num-
ber(3), xml_get_current_column_number(3) and xml_get_current_byte_index(3).
Note
Entity errors are reported at the end of the data thus only if $is_final is set and TRUE.
PHP Documentation Group XML_PARSE(3)
Check Out this Related Man Page
XML_SET_START_NAMESPACE_DECL_HANDLER(3) 1 XML_SET_START_NAMESPACE_DECL_HANDLER(3)xml_set_start_namespace_decl_handler - Set up start namespace declaration handlerSYNOPSIS
bool xml_set_start_namespace_decl_handler (resource $parser, callable $handler)
DESCRIPTION
Set a handler to be called when a namespace is declared. Namespace declarations occur inside start tags. But the namespace declaration
start handler is called before the start tag handler for each namespace declared in that start tag.
PARAMETERS
o $parser
- A reference to the XML parser.
o $handler
-$handler is a string containing the name of a function that must exist when xml_parse(3) is called for $parser. The function
named by $handler must accept three parameters, and should return an integer value. If the value returned from the handler is
FALSE (which it will be if no value is returned), the XML parser will stop parsing and xml_get_error_code(3) will return
XML_ERROR_EXTERNAL_ENTITY_HANDLING.
handler (resource $parser, string $prefix, string $uri)
o $parser
- The first parameter, parser, is a reference to the XML parser calling the handler.
o $prefix
- The prefix is a string used to reference the namespace within an XML object.
o $uri
- Uniform Resource Identifier (URI) of namespace.
If a handler function is set to an empty string, or FALSE, the handler in question is disabled.
Note
Instead of a function name, an array containing an object reference and a method name can also be supplied.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
SEE ALSO xml_set_end_namespace_decl_handler(3).
PHP Documentation Group XML_SET_START_NAMESPACE_DECL_HANDLER(3)
Hi Gurus,
I am using the following code to parse the output of a file. This code basically parses the file and adds | at the end of each field. But I am getting it wrong in some cases. I have explained it below
#----- parse output file, get each field position, -----
#----- and construct... (13 Replies)
hi , i would like to parse some file with the fallowing data :
data data data "unwanted data" data data "unwanted data"
data data data data #unwanted data.
what i want it to have any coments between "" and after # to be erased using awk or/and sed.
has anyone an idea?
thanks. (3 Replies)
I have thousands of tables compiled in a single txt document that I'm parsing with AWK. Scattered throughout the document in random sections I would like to parse out the sections that look like this:
1 Seq. Descrição do bem Tipo do bem Valor do bem (R$)
2 1 LOCALIZADO ANA RUA PESSEGO N 96... (3 Replies)
Using If_ELSE, how do check a particular piece of data in a file. My data file has three columns and say I want to check the data in the 2nd column. I want to do a comparsion against a another piece of data using IF_ELSE. How do I get that data in file to check? (1 Reply)
Hi guys...
I have been doing binary experiments yet again and came across a superb piece of code...
I extracted a very small piece and re-wrote to suit my needs:-
#!/bin/bash --posix
# bash-hexdump
# Open the file $1 to be read with an fd 3.
exec 3<"$1"
saveIFS="$IFS"
IFS=""... (9 Replies)