[英]Confusing complete in xml_parse_into_struct
用以下字符串输入xml_parse_into_struct时,“测试”被标记为完成。 对我而言,不是这样,故障会引起麻烦。
是否正确解析? 可以设置任何选项来防止“测试”崩溃吗?
<?php
$s =
'<xml>
<test>
I feel
incomplete
</test>
</xml>';
$p = xml_parser_create();
xml_parse_into_struct($p,$s,$vals,$index);
header('content-type:text/plain');
print_r($vals);
//output
Array
(
[0] => Array
(
[tag] => XML
[type] => open
[level] => 1
[value] =>
)
[1] => Array
(
[tag] => TEST
[type] => complete
[level] => 2
[value] =>
I feel
incomplete
)
[2] => Array
(
[tag] => XML
[value] =>
[type] => cdata
[level] => 1
)
[3] => Array
(
[tag] => XML
[type] => close
[level] => 1
)
)
行为是正确的。 标签是完整的,因为它包含所有数据并且已关闭并且内部没有任何标签。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.