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
Printable View
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 :D
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 thisQuote:
<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.....
Code :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")); } }