[Expat-discuss] Question on using Expat.

Nick MacDonald nickmacd at gmail.com
Fri Oct 31 06:12:54 CET 2008


eXpat is just a generic XML parser...  it will return to your program
events that help describe the XML file in the order in which it
encounters them.  You will need to make those events have meaning to
whatever task you have at hand.  You might be able to search among the
open source code on the net to see if there are any better examples of
using eXpat by searching for references to the functions of the eXpat
API...  Also do some searching among the archives for the mailing
list...  I posted a simple example file not to long back that might
get you a little further along...  I'll see if I can dig it out of my
own email archive and send it to you directly...


2008/10/30 Michael Liu <skysoshy at msn.com>:
>
>
>
> Hi all, I am new to XML parser. in my project, I want use a XML to be a config file,get the value of attribute after parse the cfg-XML.And i have no idea about how to use Expat,i had a look at outline.c.It is too sample,just output the element-name and content.It makes me to do lot of work to parse the content to get the value. Are there any way that i can get it with some API of expat?Like this<Attr Attr-name="hello" type="char" value="worlrd"\><Attr Attr-name="hi" type="int" value="0xaa"\> I will gethello= "world";hi = 0xaa Please give me your input or tricks.Thanks a lot in advance.  Best RegardsMichael
> _________________________________________________________________
> 一边聊天一边快速搜索,并把结果共享给好友,立刻试试!
> http://im.live.cn/Share/18.htm
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
>



-- 
Nick MacDonald
NickMacD at gmail.com


More information about the Expat-discuss mailing list