Hi!
I solved some problems but there are new ones now and I don't know how to continue. Any help would be much appreciated
package javaapplication2;
public class ParseLine{
public static void Parse (String myLine) throws Exception {
String myWorkLine = null;
String myTag = null;
String myValue = null;
int i=0;
if (myLine.substring(0,4).equals("<Tr ")) {
for (;i<myLine.length();i++) {
myWorkLine = myLine.substring(4);
while (!myLine.substring(0,i).equals("</Tr>")) {
myTag = myWorkLine.substring(0,myWorkLine.indexOf("="));
myWorkLine = myWorkLine.substring(myWorkLine.indexOf("=")+2);
myValue = myWorkLine.substring(0,myWorkLine.indexOf("\""));
myWorkLine = myWorkLine.substring(myWorkLine.indexOf("\"")+2);
System.out.println(myTag + " " + myValue);
if (myWorkLine.substring(0,1).equals("<")) {
myWorkLine = myWorkLine.substring(1);
while (!myLine.substring(0, i).equals("<")) {
myTag = myWorkLine.substring(0,myWorkLine.indexOf(("=")));
myWorkLine = myWorkLine.substring(myWorkLine.indexOf("=")+2);
myValue=myWorkLine.substring(0,myWorkLine.indexOf(("\"")));
myWorkLine=myWorkLine.substring(myWorkLine.indexOf("\"")+2);
System.out.println(myTag + " " + myValue);
if (myWorkLine.substring(0,2).equals("<")) {
myWorkLine = myWorkLine.substring(2);
while (!myLine.substring(0,i).equals(">")) {
myTag = myWorkLine.substring(0,myWorkLine.indexOf("<"));
myWorkLine = myWorkLine.substring(myWorkLine.indexOf("<")+1);
myValue = myWorkLine.substring(0,myWorkLine.indexOf(">"));
myWorkLine = myWorkLine.substring(myWorkLine.indexOf(">")+1);
System.out.println(myTag + " " + myValue);
} //3. while
}//3. if
} //2. while
} //2. if
} //1. while
} //for
} else //if
System.out.println("ERROR! Line doesn't start with <Tr ");
} //Parse
} //ParseLine
and this is my output. I think you can see what is wrong. Please, help. :)
rn 000000000000000 vr T sSpre S reg P dSpre 2010-01-01 dOdprt 2007-01-01 iban SI00 vir R maticnaPps 00000000000 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1 PopolnoImeRacuna>TEXT</PopolnoImeRacuna><KratkoImeRacuna>TEXT</KratkoImeRacuna><NazivPp>TEXT</NazivPp><Imetnik davcna 00000001 matSub 0000000000 drz 705 <PopolnoIme>TEXT</PopolnoIme><KratkoIme>TEXT</KratkoIme><Naslov sifTipNaslova 01 sifObcina 000 sifPosta 0000 sifUlica 0000 sifNaselje 000 stHisna 000 sifHsmid 00000000