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 369 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

We will explore how to use the JSimpleXML
parser because it is the most commonly used XML parser in Joomla!.
The first thing we need to do is obtain an instance of the parser. We do this using the
JFactory method getXMLParser(). When we use this method we must tell it which
XML parser we want to use:
$parser =& JFactory::getXMLParser('Simple');
The next step is to load and parse some XML. There are two ways in which we
can do this; we can either load XML from a file or from a pre-existing string. This
example demonstrates how we load XML from a file:
$parser->loadFile($pathToXML_File);
Loading XML from a string is a very similar process, as this example demonstrates:
$xml = '


Moving Pictures
Rush
1981

Tom Sawyer
Red Barchetta
YYZ
??? ??? ??? ??? ???
Chapter 10
[ 279 ]
Limelight
The Camera Eye
Witch Hunt
Vital Signs


';
$parser->loadString($xml);
That is all we have to do in order to parse XML using the JSimpleXML parser!
We can only use a JSimpleXML parser once; if we attempt to use the
load methods more than once, we will encounter errors.


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