本篇模拟对服务器返回xml数据以及json数据进行解析操作,获取指定值
- 运行apache
sudo apachectl -k start - xml文件
http://localhost/xml.xml
<?xml version="1.0" encoding="UTF-8"?>
<node>
<student stuId="1">
<name>张鹏</name>
<email>1234567890@qq.com</email>
<username>一样菜</username>
<code>985931</code>
</student>
<student stuId="2">
<name>王ss黑</name>
<email>2345678901@qq.com</email>
<username>冰封</username>
<code>5625362</code>
</student>
<student stuId="3">
<name>阿顿</name>
<email>23478901@qq.com</email>
<username>封</username>
<code>5625362</code>
</student>
<student stuId="4">
<name>王二</name>
<email>23478901@qq.com</email>
<username>封</username>
<code>5625362</code>
</student>
<student stuId="5">
<name>王三三</name>
<email>23478901@qq.com</email>
<username>封</username>
<code>5625362</code>
</student>
<student stuId="5">
<name>王海还</name>
<email>23478901@qq.com</email>
<username>封