Jump to content

RoxPro

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About RoxPro

  • Rank
    Newbie
  1. Thanks a lot for your explication! Thanks! OK, I tried your structure yesterday, I have another problem... I don't know if you know the TR-069, on what I'm working, the conf file isn't simply made by xml file, I have to create a XSD file to define it... The problem is, these three tags name config all of them, so I can't define three different tags with same name config, that is where I have a really difficult. I tried use _(ex: config_interface_loopback), but with expat, I have no idea how can I delete them when I parse them and create new files... So what's your suggestion Deirdre's Dad? Is there any solution feasible? Thanks!
  2. Thanks for your help, but I want to ask, if I do like what you write, it will not be easy to parse the XML file and create the file "network", because I'm using expat now, and I have already problems to parsing and creating files with it, i don't know if I do like that, it will be more complicate or not...
  3. Hi everyone, I'm new in XML. I have a little problem here, because I must write a XML file for a number of conf files. And then I'll parse it by expat. Now I have a problem, the XML file that I want to write in this way: <?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> And the conf file will be parsed like this: 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 But here's a problem, I can't make an element with spaces betweens the words, I used the program who names XMLwriter, it says "Missing equals sign between attribute and attribute value" with this tag <config interface loopback>, so can someone helps me how to make an well formed element and not so complicate to parse, thanks.
  4. I am new with XML, and expat too. So I tried use expat to parsing xml files, but it dosen't work at all.I started by element.c, example given by expat.I did these commands:gcc -c -Wall element.cgcc -o element.o element -lexpat./elementand then, it started to stop there, no response. I must use ctrl+C to stop it.Someone could help me how to use exactly the expat please? Thank you!
×
×
  • Create New...