XMLWriter.WriteXMLDeclaration

Syntax:

WriteXMLDeclaration()

Description:

You can can use it to write an XML declaration.
If an XML document (and not XML document fragment) is generated, you will need to place an XML declaration in the beginning of the document. Call this method to place an XML declaration in the document. In doing this you will need to place the following text at the beginning of the document: <?xml version="1.0"?>.
If encoding was specified when opening a file or setting a string, you should also place the 'encoding' attribute in the declaration. For example: <?xml version="1.0" encoding="UTF-8"?> XML declarations need to be written before other XML write operations.

Availability:

Thin client, server, thick client, external connection, Mobile application (client), Mobile application (server).

Example:

XMLWriter.OpenFile("c:/docs/data/xml");
XMLWriter.WriteXMLDeclaration();


    

1C:Enterprise Developer's Community