关于XML element命名问题~
大家好,我最近在做一个projet,要写一个XML文件,里面包含了多个conf文件的内容,我的目的就是用expat解析这个XML,然后生成多个conf文件,现在的问题是,我写的XML文件如下:
<?xml version="1.0" encoding="ISO-8859-1"?><note xmlns="RoxPro"xmlns:xsi="C:/Users/RoxPro/My Documents/"xsi:schemaLocation="RoxPro conf.xsd"><conf><network> <config interface loopback> <option> <ifname>lo</ifname> <proto>static</proto> <ipaddr>127.0.0.1</ipaddr> <netmask>255.0.0.0</netmask> </option> </config interface loopback> <config interface lan> <option> <ifname>eth0</ifname> <type>bridge</type> <proto>static</proto> <ipaddr>192.168.1.1</ipaddr> <netmask>255.255.255.0</netmask> </option> </config interface lan> <config interface wifi> <option> <proto>static</proto> <ipaddr>192.168.2.1</ipaddr> <netmask>255.255.255.0</netmask> </option> </config interface wifi></network><wireless> <config wifi-device radio0> <option> <type>atheros</type> <channel>auto</channel> <macaddr>00:15:6d:fc:71:ac</macaddr> <disable>0</disable> </option> </config wifi-device radio0> <config wifi-iface> <option> <device>radio0</device> <network>wifi</network> <mode>ap</mode> <ssid>OpenWrt</ssid> <encryption>none</encryption> </option> </config wifi-iface></wireless></conf></note>
config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0config interface lan option ifname eth0 option type bridge option proto static option ipaddr 192.168.1.1 option netmask 255.255.255.0config interface wifi option proto static option ipaddr 192.168.2.1 option netmask 255.255.255.0