";<br>
*<br>
* print_r(
$data
);<br>
*<br>
<br>
class
xml<br>
{<br>
var
$dbase
;
var
$dbname
;
var
$dbtable
;
var
$parser
;
var
$vals
;
var
$index
;
var
$dbtable_array
;
var
$array
;
var
$result
;
var
$querys
;<br>
<br>
function
xml(
$dbase
,
$dbtable
)<br>
{<br>
$this
->dbase=
$dbase
;<br>
$this
->dbname=
substr
(
$dbase
,
strrpos
(
$dbase
,
"/"
) 1,-4);<br>
$this
->dbtable=
$dbtable
;<br>
$data
=
$this
->ReadXml(
$this
->dbase);<br>
if
(!
$data
){<br>
die
(
"无法读取 $this->dbname.xml"
);<br>
}<br>
$this
->parser = xml_parser_create();<br>
xml_parser_set_option(
$this
->parser,XML_OPTION_CASE_FOLDING,0);<br>
xml_parser_set_option(
$this
->parser,XML_OPTION_SKIP_WHITE,1);<br>
xml_parse_into_struct(
$this
->parser,
$data
,
$this
->vals,
$this
->index);<br>
xml_parser_free(
$this
->parser);<br>
foreach
(
$this
->index
as
$key
=>
$val
) {<br>
if
(
$key
==
$this
->dbtable) {<br>
$this
->dbtable_array =
$val
;<br>
}
else
{<br>
continue
;<br>
}<br>
}<br>
for
(
$i
=0;
$i
dbtable_array);
$i
=2) {<br>
$offset
=
$this
->dbtable_array[
$i
] 1; <br>
$len
=
$this
->dbtable_array[
$i
1] -
$offset
;<br>
$value
=
array_slice
(
$this
->vals,
$offset
,
$len
);<br>
$this
->
array
[]=
$this
->parseEFF(
$value
);<br>
}<br>
return
true;<br>
}<br>
<p align=
"left"
></p><div style=
"display:none;"
>
<span id=
"url"
itemprop=
"url"
>http:
</div>
<div
class
=
"art_confoot"
></div>