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.

filter out nodes with certain id expression using xpath -


currently i've got following example xpaths of nodes want:

/html  /body   /div[@id='wp']    /div[@id='ct']     /div      /div[@id='threadlist']       /div[2]        /form         /table          /tbody[@id='normalthread_1174131']           /tr            /th             /a 

and don't need:

/html  /body   /div[@id='wp']    /div[@id='ct']     /div      /div[@id='threadlist']       /div[2]        /form         /table          /tbody[@id='stickthread_1174132']           /tr            /th             /a 

of course, select them using:

/html/body/div[@id='wp']/div[@id='ct']/div/div[@id='threadlist']                                            /div[2]/form/table/tbody[@id]/tr/th/a 

but want select nodes id normalthread_xxx. each node has different id. in other words, target page may have following nodes:

/html/body/div[@id='wp']            /div[@id='ct']             /div/div[@id='threadlist']                  /div[2]/form/table/tbody[@id='normalthread_1174133']                                     /tr/th/a  /html/body/div[@id='wp']            /div[@id='ct']             /div/div[@id='threadlist']                  /div[2]/form/table/tbody[@id='normalthread_1174134']                                     /tr/th/a 

can have similar

/html/body/div[@id='wp']            /div[@id='ct']             /div/div[@id='threadlist']                  /div[2]/form/table/tbody[@id='normalthread_xxx']                                     /tr/th/a 

, in order filter nodes here?

you should able use starts-with() (part of xpath 1.0):

/html/body/(...)/form/table/tbody[starts-with(@id,'normalthread_')]/tr/th/a 

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 -