• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help with this , urgent

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Response: : <?xml version="1.0" encoding="ISO-8859-1"?><XArC version="2.0" <document><docid>100000</docid><metainfo name ='Datum' value ='05.06.2000'></metainfo><metainfo name ='Format' value ='CIB_XML'></metainfo><metainfo name ='Kontonr' value ='2003617103'></metainfo><metainfo name ='Persnr' value ='95897543'></metainfo><appinfo name ='accessed' value =''></appinfo><appinfo name ='archived' value =''></appinfo></document><document><docid>100009</docid><metainfo name ='Datum' value ='05.06.2000'></metainfo><metainfo name ='Format' value ='CIB_XML'></metainfo><metainfo name ='Kontonr' value =''></metainfo><metainfo name ='Persnr' value ='95897543'></metainfo><appinfo name ='accessed' value =''></appinfo><appinfo name ='archived' value =''></appinfo></document><document><docid>100015</docid><metainfo name ='Datum' value ='05.06.2000'> this is a response im getting from a server , what i want to do is that i want to extract the value from "<docid>....</docid> tag , how can i do it from my java program ..im a new bee to this kindly help me ...or some ideas would be greatly appreciated..
[ April 20, 2002: Message edited by: vivek sivakumar ]
[ April 20, 2002: Message edited by: vivek sivakumar ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Vivek,
Books are written, philosophies are developed, and doctorate degrees are focused on parsing.
My beginner level strategy would be:
1. explore the new regex package and the new pattern searching/matching ability of String objects in Java 1.4
2. put the text to be parsed in a String (call it inputString)
3. find the ending position of the first occurance of "<docid>" and the beginning position of the first occurance of "</docid>" and create a new String using the aforementioned indexes as the arguments of inputString::subString(int, int)
4. repeat 3 until no more occurances of "<docid>" or "</docid>" are found.
Any ideas coming to you? I'd be curious to learn what you come up with.
Good Luck.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vivek,
I figured out a solution. It'd be my preference to work with you solving the problem, than to just tell you what I figured out. That way I'd learn a bit more, too, as together we just might figure out a better way.
So, do you have any ideas of where to begin?
 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well i have got an idea from "sherif" of mapruta (if i had spelled his name correctly) .. like he suggested on jdom , as such since i work with jdk1.2 i thought i will try out that jdom stuff before i move to 1.4 ..anyway thanks for ur hand..
once i get things done i will post it here..
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure you will be happy to see how Sheriff Mapraputa Is look like
 
reply
    Bookmark Topic Watch Topic
  • New Topic