Help / WLanguage / WLanguage functions / Standard functions / XML file functions
  • Saving the modifications in the XML file
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
XMLInsertDocument (Function)
In french: XMLInsèreDocument
Inserts the current XML tag found in an XML document into another XML document.
AndroidAndroid Widget Java An XML document can only contain a single tag at its root.
Result1 is boolean
// Inserts the current tag found in MySourceDoc into MyTargetDoc
// This tag will be a child tag of the current tag found in MyTargetDoc
Result1 = XMLInsertDocument("MyTargetDoc", "MySourceDoc", XMLChildItem)
IF Result1 = True THEN
        Info("Insertion successful")
        Info("The insertion failed")
<Result> = XMLInsertDocument(<Target XML document> , <Source XML document> [, <Insertion position>])
<Result>: Boolean
  • True if the insertion is performed,
  • False otherwise (the ErrorOccurred variable is set to True).
    To get more details on the error, use ErrorInfo.
<Target XML document>: Character string
Name of XML document into which the insertion will be performed.
<Source XML document>: Character string
Name of XML document containing the tag that will be inserted into an XML document.
<Insertion position>: Optional Integer constant
Position where the addition is performed in relation to the current tag in <Target XML document>. This parameter can take one of the following values:
XMLChildItemThe insertion is performed in the current level. The inserted part will be a child tag of the current tag.
(Default value)
The insertion is performed just after the current tag, in the same branch.
XMLPreviousElementThe insertion is performed just before the current tag, in the same branch.

Saving the modifications in the XML file

To save the modifications performed in an XML file, you must:
  1. Use the XMLBuildString function. This function retrieves and formats the content of an XML document.
  2. Save the character string generated by XMLBuildString in an XML file. To do so, use the fSaveText function.
// Once the XML document was modified
XMLSource = XMLBuildString("XMLDoc")
// Save the XML file
fSaveText("ModifiedExample.xml", XMLSource)
Business / UI classification: Business Logic
Component: wd290xml.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help