XmlCopyFile: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


==Syntax==  
==Syntax==  
Server:
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
xmlnode xmlCopyFile ( xmlnode nodeToCopy, string newFilename, resource root = getThisResource () )
xmlnode xmlCopyFile ( xmlnode nodeToCopy, string newFilename, [ resource inResource = getThisResource() ] )
</syntaxhighlight>  
</syntaxhighlight>  


Client:
===Required Arguments===
*'''nodeToCopy:''' the [[xmlnode]] that is to be copied to a new document.
*'''newFilename:''' the filename for the new XML document.
 
===Optional Arguments===
{{OptionalArg}}
*'''inResource:''' the [[resource]] whose directory will be used as the root for the filename specified. Note that if a different resource than default is being accessed, the caller resource needs access to general.ModifyOtherObjects in the [[ACL]].
 
===Returns===
Returns a [[xmlnode]] if the node was successfully copied, ''false'' if invalid arguments were passed.
</section>
 
<section name="Client" class="client" show="false">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
xmlnode xmlCopyFile ( xmlnode nodeToCopy, string newFilename )
xmlnode xmlCopyFile ( xmlnode nodeToCopy, string newFilename )
</syntaxhighlight>  
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
Line 20: Line 32:
===Returns===
===Returns===
Returns a [[xmlnode]] if the node was successfully copied, ''false'' if invalid arguments were passed.
Returns a [[xmlnode]] if the node was successfully copied, ''false'' if invalid arguments were passed.
</section>


==Example==  
==Example==  

Revision as of 01:10, 21 October 2007

This function copies all contents of a certain node in a XML document to a new document file, so the copied node becomes the new file's root node.

Syntax

Click to collapse [-]
Server
xmlnode xmlCopyFile ( xmlnode nodeToCopy, string newFilename, [ resource inResource = getThisResource() ] )

Required Arguments

  • nodeToCopy: the xmlnode that is to be copied to a new document.
  • newFilename: the filename for the new XML document.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • inResource: the resource whose directory will be used as the root for the filename specified. Note that if a different resource than default is being accessed, the caller resource needs access to general.ModifyOtherObjects in the ACL.

Returns

Returns a xmlnode if the node was successfully copied, false if invalid arguments were passed.

Click to expand [+]
Client

Example

See Also