SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 374 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

This method returns any
data that is contained within a node. Remember that the getElementByPath()
method returns JSimpleXMLElement objects, and title, artist, and year are nodes
in their own right.
We are now left with one last thing to do. We need to get the track listing for each
album. To do this, we will iterate over the tracks node child nodes:
if ($tracks =& $album->getElementByPath('tracks'))
{
// get the track listing
$listing =& $tracks->track;
// output listing table
echo '';
for ($ti = 0, $tc = count($listing); $ti < $tc; $ti ++)
{
// output an individual track
$track =& $listing[$ti];
echo '';
echo '';
echo '';
echo '';
}
echo '
TrackLength
'.$track->data().''.$track->attributes('length').'
';
}
APIs and Web Services
[ 282 ]
We retrieve the tracks node using getElementByPath(). We get each track using
the track attribute. We get the name of the track using the data() method. We get
the track length attribute using the attributes() method.


Pages:
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6