hello there i'm new in java programming and i have problems with a project of mine for my university!!!i would be glad to take a response thnks alot
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
hello there i'm new in java programming and i have problems with a project of mine for my university!!!i would be glad to take a response thnks alot
Hello and welcome
Any chance you could tell us what the problem is and we'll see if anyone can offer you some help.
// Json
yes off course!!my project uses regex in order to take information from weathersites for the weatherforecast in different areas.i have created the xml input but my problem is that i deal alot of problems combinig it with java!to be more specific...
i don't want to give an exact number of cities so my in java code when parsing the xml i should have to 2D tables so this confuses me alot and in the output i deal the same problems so this is where i want your help thanks alot
What does the XML look like and how are you trying to parse it?
// Json
my xml looks likes:
it's only a sample! and i parse it like this<config>
<site>
<sname>meteo.gr<sname>
<surl><![CDATA[http://www.meteo.gr/#]]></surl>
<regexps>
<reg name="unique">
<start><![CDATA[<td class="SmallText">]]</start>
<end><![CDATA[ <tr class="TRstyle1">]]</end>
<reg name="hmeromhnia"> //attribute
<start><![CDATA[ <td class="HeadG">]]></start>
<end><![CDATA[</td>]]></end>
</reg>
<reg name="wra">
<start><![CDATA[<td colspan="2" class="HeadG">]]></start>
<end><![CDATA[</td>]]></end>
</reg>
<reg name="thermokrasia">
<start><![CDATA[ <td class="HeadG">]]></start>
<end><!CDATA[</td>]]></end>
</reg>
<reg name="ugrasia">
<start><![CDATA[ <td class="HeadG">]]></start>
<end><!CDATA[</td>]]></end>
</reg>
here is the part that i'm not sure i'm doing right!!i should have 2Dtables one for the regex and one for the cities and their urls so i don't know if this is the right way to do so.....
if(reg_is.child("end").content()=="") error += "\tNo suffix reg.exp. given.\n"; else suffix = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content())); } else{ poleis[k][0]= HtmlMethods.removeBreaks(reg_is.string("name")); poleis[k][1] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("start").content())); poleis[k][2] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content())); k++; } } } for(Xml polh_is:fetchsite.child("site").child("poleis").children("polh")){ //url theloume mia for akoma if((polh_is.string("name")=="")||(polh_is.content()==""))//attribute error += "Error in polh: name is - " + polh_is.string("name") + " with url - " + polh_is.content() + " -.\n"; else for(int j=0; j<citylink.length; j++){ citylink[j][0]=HtmlMethods.removeBreaks(polh_is.string("name")); citylink[j][1]=HtmlMethods.removeBreaks(polh_is.string("with url -"+polh_is.content() +"-.\n")); } }
Last edited by Json; May 26th, 2010 at 03:36 AM.