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 - JDOM.Element.getChild(String) is returning unexpected results -


according api @ jdom.org, semantics of getchild(string name):

this returns first child element within element given local name , belonging no namespace. if no elements exist specified name , namespace, null returned.

therefore, if have xml structure like:

<?xml version="1.0" encoding="utf-8"?> <lvl1>     <lvl2>         <lvl3/>     </lvl2> </lvl1> 

i have jdom element pointing <lvl1>. should able make following call:

element lvl3 = lvl1element.getchild("lvl3"); 

and lvl3 should have non-null.

however, i'm finding lvl3 null. missing something?

here sample code snippet should work:

import java.io.stringreader; import org.jdom.*; public static void main(string[] args){     document doc = new saxbuilder().build(new stringreader("path file"));     element lvl1element = doc.getrootelement();     element lvl3element = lvl1element.getchild("lvl3"); //is null. why? } 

in order functionality looking for, used iterator getdescendants(elementfilter) function jdom.org

i got element looking using code similar following:

element lvl3 = lvl1.getdescendants(new elementfilter("lvl3")); 

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 -