Difference between revisions of "JSimpleXML/loadFile"
From Joomla! Documentation
< API15:JSimpleXML
(New page: ===Description===
Interprets an XML file into an object
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>...) |
m (removing red link to edit, no existant pages) |
||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 58: | Line 58: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
Line 73: | Line 73: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Revision as of 13:49, 12 May 2013
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Interprets an XML file into an object
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
loadFile($path, $classname=null)
Parameter Name | Default Value | Description |
---|---|---|
$path | Path to xml file containing a well-formed XML document | |
$classname | null | currently ignored |
Returns[edit]
boolean True if successful, false if file empty
Defined in[edit]
libraries/joomla/utilities/simplexml.php
Importing[edit]
jimport( 'joomla.utilities.simplexml' );
Source Body[edit]
function loadFile($path, $classname = null)
{
//Check to see of the path exists
if ( !file_exists( $path ) ) {
return false;
}
//Get the XML document loaded into a variable
$xml = trim( file_get_contents($path) );
if ($xml == '')
{
return false;
}
else
{
$this->_parse($xml);
return true;
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
<CodeExamplesForm />