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.

php - xml + xpath, print element -


notice: undefined property: domnodelist::$id in d:\wamp\www\xml\index.php on line 15 id:  notice: undefined property: domnodelist::$name in d:\wamp\www\xml\index.php on line 16 name:  <?php $xml = new domdocument();  $xml->load('test.xml');  $xpath = new domxpath($xml);  $query = '/people/person[id="33333"]';  $entries = $xpath->query($query);  echo 'id:'. $entries->id.'<br/>'; echo 'name:'.$entries->name.'<br/>'; ?> 

xml file sample:

<people> ...     <person>         <phone>33333</phone>         <name>aadgar</name>         <last_name>adas</last_name>     </person> ... </people> 

first, id node doesn't exists...

$query = '/people/person[id="33333"]'; 

i think want:

$query = '/people/person[phone="33333"]'; 

then, must do:

$entries = $xpath->query($query);  foreach ($entries $entry) {    echo 'name:'. $entry->getelementsbytagname('name')->item(0)->nodevalue.'<br/>';    echo 'last_name:'.$entry->getelementsbytagname('last_name')->item(0)->nodevalue.'<br/>'; } 

it seems mixing dom , simplexml syntax.


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 -