PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Saving the modifications in the XML file
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
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.
AndroidAndroid Widget Java An XML document can only contain a single tag at its root.
Versions 17 and later
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Syntax
<Result> = XMLInsertElement(<Name of 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 find out the error details, use ErrorInfo.
<Name of 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.
AndroidAndroid Widget Java This constant is ignored for the attributes.
XMLNextElementThe insertion is performed just after the current element, in the same branch.
AndroidAndroid Widget Java This constant is ignored for the attributes.
XMLChildItem
(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.
Remarks

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.
Example:
// Once the XML document was modified
XMLSource = XMLBuildString("XMLDoc")
// Save the XML file
fSaveText("ModifiedExample.xml", XMLSource)
Components
WINDEVWEBDEV - Server codeReports and Queries wd230xml.dll
Windows Mobile wp230xml.dll
Java wd230java.jar
Linux wd230xml.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment