Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extracting elelents data with kXML

 
Mary White
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to use kXML in an iPAQ application,
How can extract the element information with this API.
For example, if I have
<employee>
<firstName>John</firstName>
<lastName>John</lastName>
<employee>
How can I extract the information in the first na last name to retrieve John and Smith?
Thanks
Mary.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disclaimer: I didn't even compile this so there's absolutely no guarantees that this will work out-of-the-box, but it should give you a general idea of how the pull-based kXML API works...
 
Mary White
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks Lasse for your reply.
Do you know how can I create an org.kxml.kdom.Document object or an org.kxml.kdom.Element object from an xml file.
The methods in these classes would work better for me, since I need to retrive specific elements, without reading the complete xml element by element.
Thanks
Mary.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!