XmlCreateSubNode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Replaced Deprecated template with DeprecatedWithAlt) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
{{ | {{DeprecatedWithAlt|xmlCreateChild|}} | ||
This function creates a subnode for a specified XML node. | This function creates a subnode for a specified XML node. |
Revision as of 18:24, 11 November 2011
This function creates a subnode for a specified XML node.
Syntax
xmlnode xmlCreateSubNode ( xmlnode parentNode, string tagname )
Required Arguments
- parentNode: the xmlnode you want to create a subnode of.
- tagname: the type of the subnode that will be created.
Returns
Returns the created xmlnode if successful, false otherwise.
Example
Click to collapse [-]
ServerWe need to create a new node between the tags <config> and </ config>. config.xml:
<config> <newnode>somevalue</newnode> </config>
Lua code:
function() config = xmlLoadFile("config.xml") local newNode = xmlCreateSubNode ( config, "newnode" ) xmlNodeSetValue ( newNode, "somevalue" ) xmlSaveFile( config ) end
See Also
- xmlCopyFile
- xmlCreateChild
- xmlCreateFile
- xmlDestroyNode
- xmlFindChild
- xmlLoadFile
- xmlLoadString
- xmlNodeGetAttribute
- xmlNodeGetAttributes
- xmlNodeGetChildren
- xmlNodeGetName
- xmlNodeGetParent
- xmlNodeGetValue
- xmlNodeSetAttribute
- xmlNodeSetName
- xmlNodeSetValue
- xmlSaveFile
- xmlUnloadFile