当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > xml_set_notation_decl_handler(

PHP
php 无限分类的实现
常用PHP代码
windows下安装配置php视频教程
MySQL数据库结构和数据的导出和导入
PHP实现 IP Whois 查询
PHP5 this,self和parent关键字详解
PHP 安全技巧连载 #1[译]
PHP 安全技巧连载 #2[译]
PHP 安全技巧连载 #3[译]
PHP 安全技巧连载 #4[译]
PHP 安全技巧连载 #5[译]
PHP 安全技巧连载 #6[译]
PHP 安全技巧连载 #7[译]
PHP 安全技巧连载 #8[译]
PHP 安全技巧连载 #9[译]
PHP 安全技巧连载 #10[译]
PHP 安全技巧连载 #11[译]
PHP error_reporting的使用
PHP 安全技巧连载 #12
使用PHP做Linux/Unix守护进程

PHP 中的 xml_set_notation_decl_handler(


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 460 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The xml_set_notation_decl_handler() function specifies a function to be called when the parser finds a notation declaration in the XML document.
xml_set_notation_decl_handler()函数的作用是:设置处理ZML文档中符号声明的函数。

This function returns TRUE on success, or FALSE on failure.
如果函数执行成功,将返回True;如果执行失败将返回False。

Syntax
语法

xml_set_notation_decl_handler(parser,handler)

Parameter参数 Description描述
parser Required. Specifies XML parser to use
必要参数。指定需要使用的XML解析器
handler Required. Specifies a function to be when the parser finds a notation declaration
必要参数。指定处理ZML文档中符号声明的函数

The Function specified by the "handler" parameter must have five parameters:

Parameter参数 Description描述
parser Required. Specifies a variable containing the XML parser calling the handler
必要参数。指定一个包含XML解析器的可用值
name Required. Specifies a variable containing the name of the notation declaration
必要参数。指定包含外部实体名称的变量
base Required. Specifies the base for resolving the system identifier (system_id) of the notation declaration. Currently, this is always NULL
必要参数。指定解析外部实体的系统标志符的base[基准]。当前值通常为NULL[空]
system_id Required. Specifies a variable containing the system identifier for the notation declaration
必要参数。指定外部实体的系统标志符
public_id Required. Specifies a variable containing the public identifier for the notation declaration
必要参数。指定外部实体的公共标志符


Tips and Notes
注意点

Note: The handler parameter can also be an array containing an object reference and a method name.
注意:handler参数可以是一个包含对象参数和方法名称的数组。


Example
案例

<?php
$parser=xml_parser_create();
function char($parser,$data) { echo $data; }
function not_decl_handler($parser,$not,$base,$sysID,$pubID) { echo "$not<br />"; echo "$sysID<br />"; echo "$pubID<BR />"; }
xml_set_character_data_handler($parser,"char");
xml_set_notation_decl_handler($parser, "not_decl_handler");
$fp=fopen("test.xml","r");
while ($data=fread($fp,4096)) { xml_parse($parser,$data,feof($fp)) or die (sprintf("XML Error: %s at line %d", xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser))); }
xml_parser_free($parser);
?>

评论 (0) All

登陆 | 还没注册?