<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="xslif4.xsl"?>
<roster>
<student ID="101">
<name>Tom</name>
<score>92</score>
</student>
<student ID="102">
<name>Jerry</name>
<score>89</score>
</student>
<student ID="103">
<name>Joun</name>
<score>98</score>
</student>
<student ID="104">
<name>White</name>
<score>85</score>
</student>
<student ID="105">
<name>David</name>
<score>86</score>
</student>
</roster>
对节点作增删改,要求
1。增加一个student ID="106"的对应信息,或者在某个学生的节点下增加一个节点
2。删除一个节点,不仅仅可以删除name,score等子节点,而且也可以删除某个学生的全部对应的节点
3。改同上新手上路,给点提示
用结构体能实现吗?
<?xml-stylesheet type="text/xsl" href="xslif4.xsl"?>
<roster>
<student ID="101">
<name>Tom</name>
<score>92</score>
</student>
<student ID="102">
<name>Jerry</name>
<score>89</score>
</student>
<student ID="103">
<name>Joun</name>
<score>98</score>
</student>
<student ID="104">
<name>White</name>
<score>85</score>
</student>
<student ID="105">
<name>David</name>
<score>86</score>
</student>
</roster>
对节点作增删改,要求
1。增加一个student ID="106"的对应信息,或者在某个学生的节点下增加一个节点
2。删除一个节点,不仅仅可以删除name,score等子节点,而且也可以删除某个学生的全部对应的节点
3。改同上新手上路,给点提示
用结构体能实现吗?
方法多了
把xml当作一个对象,它包含一个个节点,有相应的方法进行操作