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.