PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Saves an XML document in a file.
Versions 15 and later
If an XSD description was used, this one is automatically used to validate the XML document during its backup.
New in version 15
If an XSD description was used, this one is automatically used to validate the XML document during its backup.
If an XSD description was used, this one is automatically used to validate the XML document during its backup.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
AndroidAndroid Widget This function is available from Android version 2.2.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
AndroidAndroid Widget This function is available from Android version 2.2.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
AndroidAndroid Widget This function is available from Android version 2.2.
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.
Example
MyXMLDocument is xmlDocument
...
Filter is string = "XML files (*.xml)" + TAB + "*.xml" + CR + ...
"All files (*.*)" + TAB + "*.*"
OutputFile is string = fSelect("", "", "Select an XML file...", ...
Filter, "xml", fselCreate)
IF OutputFile <>"" THEN
XMLSave(MyXMLDocument, OutputFile, XMLDocumentDefault)
IF ErrorOccurred = True THEN
ErrorBuild("An error occurred during the backup: %1", ...
ErrorInfo(errFullDetails))
END
END
// The description of the XML file named "stream" was imported into the project.
// A blank XML file will be created from this description.
// The XML file does not physically exist yet.

// Load the XML content
MyXMLDoc is xmlDocument,description="stream"
MyXMLDoc.rss.Channel[1].Title = gsParamTitle
MyXMLDoc.rss.Channel[1].Link = gsParamSiteAddress
MyXMLDoc.rss.Channel[1].Description = gsParamSiteDescription
MyXMLDoc.rss.Channel[1].Copyright = gsParamCopyright
MyXMLDoc.rss.Channel[1].Webmaster = gsParamContactAddress
MyXMLDoc.rss.Channel[1].Image = gsParamURLSiteImage
MyXMLDoc.rss.Channel[1].Generator = "Easy RSS"
// Save the file
XMLSave(MyXMLDoc, gsPathXMLFile)
// Save the file with formatting (new feature of version 22)
XMLSave(MyXMLDoc, gsPathXMLFile_With_Formatting, XMLFormatting)
Syntax
XMLSave(<XML Document> [, <File Name and Path>] [, <Options>] )
<XML Document>: xmlDocument variable
xmlDocument variable containing the document to save. This variable can be the result of a call to XMLOpen or it may have been declared and initialized directly.
<File Name and Path>: Optional ANSI or Unicode character string
Name and full (or relative) path of text file to create. A UNC path can be used.
If this parameter is not specified or if it is set to "" (empty string):
  • When XMLSave is called for the first time on this document, the XML document is saved at the location specified during its opening (XMLOpen).
  • During the next calls to XMLSave, the XML document is saved at the location specified during the previous backup.
  • An error occurs if the XML document was not opened by XMLOpen (opened from a URL, from a string or if the document was created).
Windows Mobile No relative path can be used.
<Options>: Optional Integer constant
Options for saving the XML document.
The possible values are:
XMLDocumentDefault
(default value)
Saves the XML document with a header.
Versions 22 and later
XMLFormatting
New in version 22
XMLFormatting
XMLFormatting
Saves the XML document with formatting (indent and carriage returns).
AndroidAndroid Widget Java This constant is not available.
XMLNoHeaderSaves the XML document without header. This constant can be used when the XML document corresponds to a fragment of a more important document, concatenated with other XML documents thereafter.
xvNoValidationSaves the XML document without taking into account the XSD model specified when describing the XML document.
Versions 17 and later
AndroidAndroid Widget Java This constant is not available.
New in version 17
AndroidAndroid Widget Java This constant is not available.
AndroidAndroid Widget Java This constant is not available.
Remarks
When describing an XML document, you have the ability to specified the XSD file that will be used as validation model for the XML file. For example:
cMyDoc is xmlDocument <description="person.xsd">
By default, this XSD file is taken into account when saving the document: the document validity is automatically checked before saving the XML document (equivalent to XMLValidDocument). To avoid performing this validation, all you have to do is used the xvNoValidation constant.
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 15
This page is also available for…
Comments
Click [Add] to post a comment