Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Parsing

 
kk pournami
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two XML's in a single file. I want to read those files and display the values of that file for ex:

File Example

1--
<book>
<bookname>ABC</bookname>
</book>

<student>
<studentid>5</studentid>
</student>


now if i parse the file Example i should get the output as

ABC
5

how can i do this???
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It is an XML document that is not well formatted.
I understand that any xml parser could read these two documents in one file.

You have to read the file and tokenize it with your own custom code.

Best regards,
 
bala nannaka
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can take use of DOMParser class

the code looks some thing like this
 
kk pournami
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need it in DotNet.it should take all xml files read them one by one and display data ..Help me please
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to parse the XML in a .Net language? I would suggest you to look for the language APIs present in the .Net language you are using. I am sure the language will have some implementation of a DOM parser/SAX parser. You can put some effort and search for the APIs present in the language you are using.
 
kk pournami
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for helping me out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic