Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > using expat parser how to build a tree shaped data structure of a xml document and read the value from it in c language

Reply
Thread Tools

using expat parser how to build a tree shaped data structure of a xml document and read the value from it in c language

 
 
sharan
Guest
Posts: n/a
 
      11-03-2007
using expat parser how to build a tree shaped data structure of a xml
document and read the value from it in c language so that whenever we
gave a key as a input it give the vale of that key.
i have to do this without using DOM and Schema, just make a general
tree from xml document which contains the tag value and attribute
value on each node.
means root node have user, its child node user1, user2, user3, and
each child node have name, age, department and each node have this
key along its value(either text or attributes value)
my xml file is:
<?xml version="1.0"?>
<users>
<user id="1" text="hello">
<name> Hari Oum </name>
<age> 24 </age>
<department> Product Development </department>
</user>

<user id="2">
<name> Sandeep </name>
<age> 23 </age>
<department> VoiceXML Applications </department>
</user>

<user id="3">
<name> Jeganathan </name>
<age> 24 </age>
<department> Java Applications </department>
</user>

</users>
if i give the key for user2 --name than it print Sandeep if give for
user 3 key --age then it will print 24, so please help me without use
DOM and schema. i have little bit idea about expat parser.

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      11-03-2007
Read up on the SAX APIs, then read Expat's documentation. Then write code.

(Homework assignment, right?)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
 
sharan
Guest
Posts: n/a
 
      11-04-2007
On Nov 3, 7:56 pm, Joe Kesselman <keshlam-nos...@comcast.net> wrote:
> Read up on the SAX APIs, then read Expat's documentation. Then write code.
>
> (Homework assignment, right?)
>
> --
> () ASCII Ribbon Campaign | Joe Kesselman
> /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


i know about expat parser i want only a idea about that how to
implement data structure (tree ) to read xml document.

 
Reply With Quote
 
=?ISO-8859-1?Q?J=FCrgen_Kahrs?=
Guest
Posts: n/a
 
      11-04-2007
sharan schrieb:

> i know about expat parser i want only a idea about that how to
> implement data structure (tree ) to read xml document.


Have a look at this wrapper:

http://www.nongnu.org/scew/

Other wrappers can be found here:

http://expat.sourceforge.net/#wrappers
 
Reply With Quote
 
Pavel Lepin
Guest
Posts: n/a
 
      11-05-2007

sharan <> wrote in
< .com>:
> On Nov 3, 7:56 pm, Joe Kesselman
> <keshlam-nos...@comcast.net> wrote:
>> Read up on the SAX APIs, then read Expat's documentation.
>> Then write code.
>>
>> (Homework assignment, right?)

>
> i know about expat parser i want only a idea about that
> how to implement data structure (tree ) to read xml
> document.


Refer to the notes you've been jotting down in your Data
Structures and/or C classes. If you haven't been taking
notes, practice asking "Would you want fries with that?" in
front of a mirror.

--
"I can't help but wonder if you... don't know a hell of a
lot more about practically every subject than Solomon ever
did."
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
A c program which printing the tag value of a xml file using expat parser in linux environment sharan XML 5 08-26-2011 09:36 AM
build a hierarchical tree, without using DOM,schema, and sax using expat parser and c pharioum@gmail.com XML 2 11-05-2007 02:24 PM
Want help on how we convert output to tabular format Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format. sharan XML 1 10-26-2007 01:20 PM
Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format. Want a c program on that! sharan XML 1 10-26-2007 07:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57