XML 加载类¶
| 属性 | 值 |
|---|---|
| 命名空间 | fize\xml |
| 类名 | SimpleXml |
| 方法: |
|---|
| 方法名 | 说明 |
|---|---|
| importDom() | 从一个DOMNode对象返回一个对应的SimpleXMLElement对象 |
| loadFile() | 从文件载入xml到一个SimpleXMLElement对象并返回 |
| loadString() | 从xml字符串载入到一个SimpleXMLElement对象并返回 |
方法¶
importDom()¶
从一个DOMNode对象返回一个对应的SimpleXMLElement对象
public static function importDom (
\DOMNode $node,
string $class_name = "SimpleXMLElement"
) : \SimpleXMLElement
| 参数: |
|
||||||
|---|---|---|---|---|---|---|---|
| 返回值: | 根据参数$class_name也可能返回SimpleXMLElement扩展类,错误时返回false |
参数 `$class_name` :
该类必须是SimpleXMLElement或扩展自SimpleXMLElement。
loadFile()¶
从文件载入xml到一个SimpleXMLElement对象并返回
public static function loadFile (
string $filename,
string $class_name = "SimpleXMLElement",
int $options = 0,
string $ns = "",
bool $is_prefix = false
) : \SimpleXMLElement
| 参数: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 返回值: | 根据参数$class_name也可能返回SimpleXMLElement扩展类,错误时返回false |
参数 `$class_name` :
该类必须是SimpleXMLElement或扩展自SimpleXMLElement。
loadString()¶
从xml字符串载入到一个SimpleXMLElement对象并返回
public static function loadString (
string $data,
string $class_name = "SimpleXMLElement",
int $options = 0,
string $ns = "",
bool $is_prefix = false
) : \SimpleXMLElement
| 参数: |
|
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 返回值: | 根据参数$class_name也可能返回SimpleXMLElement扩展类,错误时返回false |
参数 `$class_name` :
该类必须是SimpleXMLElement或扩展自SimpleXMLElement。