XmlLoadFile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function provides an alternative way to load XML files to [[getResourceConfig]]. | |||
This function loads an XML file | This function loads an XML file and returns the node by specifying a specific file path, while [[getResourceConfig]] allows for loading an XML file from a resource. | ||
==Syntax== | ==Syntax== | ||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
xmlnode xmlLoadFile ( string filename ) | xmlnode xmlLoadFile ( string filename ) | ||
Line 10: | Line 11: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''filename:''' The path to the file you wish to load. | *'''filename:''' The path to the file you wish to load. This can be an absolute file path, or relative to the '''server directory'''. | ||
</section> | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
xmlnode xmlLoadFile ( string filename ) | |||
</syntaxhighlight> | |||
===Required Arguments=== | |||
*'''filename:''' The path to the file you wish to load. This can be an absolute file path, or relative to the '''Grand Theft Auto San Andreas installation directory.'''. | |||
</section> | |||
===Returns=== | ===Returns=== | ||
Returns | Returns the root [[xmlnode]] object of an xml file if successful, or ''false'' otherwise. | ||
==Example== | ==Example== |
Revision as of 18:26, 5 September 2007
This function provides an alternative way to load XML files to getResourceConfig. This function loads an XML file and returns the node by specifying a specific file path, while getResourceConfig allows for loading an XML file from a resource.
Syntax
Click to collapse [-]
Serverxmlnode xmlLoadFile ( string filename )
Required Arguments
- filename: The path to the file you wish to load. This can be an absolute file path, or relative to the server directory.
Click to collapse [-]
Clientxmlnode xmlLoadFile ( string filename )
Required Arguments
- filename: The path to the file you wish to load. This can be an absolute file path, or relative to the Grand Theft Auto San Andreas installation directory..
Returns
Returns the root xmlnode object of an xml file if successful, or false otherwise.
Example
This example loads an XML file called test.xml.
node = xmlLoadFile ( "test.xml" )
See Also
- xmlCopyFile
- xmlCreateChild
- xmlCreateFile
- xmlDestroyNode
- xmlFindChild
- xmlLoadFile
- xmlLoadString
- xmlNodeGetAttribute
- xmlNodeGetAttributes
- xmlNodeGetChildren
- xmlNodeGetName
- xmlNodeGetParent
- xmlNodeGetValue
- xmlNodeSetAttribute
- xmlNodeSetName
- xmlNodeSetValue
- xmlSaveFile
- xmlUnloadFile