XMLCanonicalizingWriter.WriteXMLDeclaration

Syntax:

WriteXMLDeclaration()

Description:

You can use it to write XML declaration.
If XML document (not XML document fragment) is generated, you should place XML declaration in the beginning of the document. Call this method to place an XML declaration in the document. You should 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. E.g., <?xml version="1.0" encoding="UTF-8"?> XML declarations must be written before other XML write operations.

Availability:

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

Example:

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


    

1C:Enterprise Developer's Community