OTX Reference  
OpenTestSystem.Otx.Extensions.XML.Actions.XmlSaveToFile Class Reference

Writes the XmlDocument in a file. More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.XML.Actions.XmlSaveToFile:
Inheritance graph

Public Attributes

XmlDocumentTerm document
 The XmlDocument object to which the operation is applied. More...
 
StringTerm path
 The URI path to the file. The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. The format of the file or directory name (e.g. case -sensitive) depends on the operating system. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Validity of ActionRealisation. More...
 

Detailed Description

Writes the XmlDocument in a file.

The XmlSaveToFile activity writes the XmlDocument in a file. Please note that all changes via write actions are effective only on the file handle. Only with XmlSaveToFile are the changes written to the file.

The document is serialized using its encoding. The resulting file shall contain a prolog which specifies the character encoding and XML version.
For encodings which require a byte-order mark (BOM), such as UTF-16, a BOM shall be inserted before the prolog. For other encodings, it is unspecified whether a BOM will be inserted.

Note
NOTE — If the directory does not exist, the directory and all ancestors shall be created automatically.
Exceptions
Exceptions.XmlFormatException
File.Exceptions.FileSaveException
Syntax
Xml.XmlSaveToFile(XmlDocumentTerm document, StringTerm path);
XmlDocumentTerm document
The XmlDocument object to which the operation is applied.
Definition: XML.cs:360
StringTerm path
The URI path to the file. The path parameter is permitted to specify relative or absolute path inform...
Definition: XML.cs:370
Examples
// Local Declarations
Xml.XmlElement XmlElement1;
Xml.XmlDocument XmlDocument1;
// Flow
XmlElement1 = Xml.CreateXmlElement("root", "text", {"attribute":"abc"});
XmlDocument1 = Xml.CreateXmlDocument(XmlElement1, "1.0", @Encoding:UTF-8, false);
Xml.XmlSaveToFile(XmlDocument1, "XmlStorage/XmlSaveToFile_TC01.xml");

Member Data Documentation

◆ document

XmlDocumentTerm OpenTestSystem.Otx.Extensions.XML.Actions.XmlSaveToFile.document

The XmlDocument object to which the operation is applied.

◆ path

StringTerm OpenTestSystem.Otx.Extensions.XML.Actions.XmlSaveToFile.path

The URI path to the file. The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. The format of the file or directory name (e.g. case -sensitive) depends on the operating system.