Home | Sign in | English EN
  • Saving the modifications in the XML file
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
XMLInsertElement (Function)
In french: XMLInsèreElement
Inserts an XML element (tag or attribute) into an XML document. The insertion position is relative to the current position.
Java An XML document can only contain a single tag at its root.
<Result> = XMLInsertElement(<XML document> , <Element name> [, <Value of inserted element> [, <Insertion position> [, <Change of position>]]])
<Result>: Boolean
  • True if the insertion was performed,
  • False otherwise (the ErrorOccurred variable is set to True).
    To get the details of the error, use ErrorInfo.
<XML document>: Character string with quotes
XML document into which the insertion will be performed.
<Element name>: Character string with quotes
Name of element to add. The added element and the current element have the same type:
  • If the current element is a tag, the inserted element is a tag.
  • If the current element is an attribute, the inserted element is an attribute.
<Value of inserted element>: Optional character string with quotes
Value of new element. This parameter corresponds to an empty string ("") by default.
<Insertion position>: Optional Integer constant
Position where the addition is performed in relation to the current element. This parameter can take one of the following values:
XMLPreviousElementThe insertion is performed just before the current element, in the same branch.
Java This constant is ignored for the attributes.
XMLNextElementThe insertion is performed just after the current element, in the same branch.
Java This constant is ignored for the attributes.
(Default value)
The insertion is performed in the current level. The inserted part will be a child element of the current element.
<Change of position>: Optional boolean
  • True to be positioned on the added element. In this case, the added element becomes the current position.
  • False (default value) to avoid modifying the current position during the addition.

Saving the modifications in the XML file

To save the modifications performed in an XML file, you must:
  1. Use XMLBuildString. 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 fSaveText.
// Once the XML document was modified
XMLSource = XMLBuildString("XMLDoc")
// Save the XML file
fSaveText("ModifiedExample.xml", XMLSource)
Business / UI classification: Business Logic
Component: wd260xml.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment