Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - How to adjust my code to this situation for SAX XML parsing in Android -


on advice on here on stackoverflow changed method of parsing saxparser.

thanks different tutorials i'm able work, , have work faster (which important app).

the problem, however, xml file goes deeper tutorial's example xml's i've seen.

this sample of xml file:

<message>      <service>servicename</service>    <insurances>      <breakdowninsurance>        <name>insurance name</name>        <insurancenr/>        <licensenr/>      </breakdowninsurance>      <cardamageinsurance>        <name>insurance name 2</name>        <insurancenr></insurancenr>      </cardamageinsurance>   </insurances>    <personal>     <name>my name</name>   </personal> </message> 

i can personal details name, code doesn't seem work insurances. think because it's 1 node more.

this code i'm using in handler class:

@override public void startelement(string namespaceuri, string localname, string qname, attributes atts) throws saxexception {     currentelement = true;     if (localname.equals("message")) {         geg = new gegevensxml();     } }  @override public void endelement(string namespaceuri, string localname, string qname) throws saxexception {     currentelement = false;      /********** autopech **********/     if (localname.equals("name")) {         geg.setautopechmaatschappij(currentvalue);     }     else if (localname.equals("insurancenr")){         geg.setautopechpolis(currentvalue);     }     else if (localname.equals("licensenr")){         geg.setautopechkenteken(currentvalue);     }  @override public void characters(char ch[], int start, int length) {     if (currentelement) {         currentvalue = new string(ch, start, length);         currentelement = false;     } 

so how must adjust it?

@override public void startelement(string namespaceuri, string localname, string qname, attributes atts) throws saxexception {     currentelement = true;     if (localname.equals("message")) {         geg = new gegevensxml();     }     if(localname.equals("breakdowninsurance"))     {       breakdowninsurance = true;     } }  @override public void endelement(string namespaceuri, string localname, string qname) throws saxexception {     currentelement = false;      /********** autopech **********/     if (localname.equals("name"))     {      if(breakdowninsurance)      {        geg.setbreakdowninsurancename(currentvalue);         breakdowninsurance = false;      }      else      {        geg.setautopechmaatschappij(currentvalue);       }      }     else if (localname.equals("insurancenr")){         geg.setautopechpolis(currentvalue);     }     else if (localname.equals("licensenr")){         geg.setautopechkenteken(currentvalue);     }   

similarly other cases... 'breakdowninsurance' boolean. use flag...


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -