4D v13.4

SAX SET XML DECLARATION

Home

 
4D v13.4
SAX SET XML DECLARATION

SAX SET XML DECLARATION 


 

SAX SET XML DECLARATION ( document ; encoding {; standalone {; indentation}} )  
Parameter Type   Description
document  DocRef in Reference of open document
encoding  String in XML document character set
standalone  Boolean in True = the document is standalone False (default) = document is not standalone
indentation  Boolean in *** Obsolete, do not use ***

The SAX SET XML DECLARATION command initializes the XML document referenced in document using the values passed in the parameter. These parameters allow determining the encoding, standalone attribute and document indentation.

  • encoding: Indicates the character set used in the document. By default (if the command is not called), the UTF-8 character set (compressed Unicode) is used.
  • standalone: Indicates whether the document is standalone (True) or if it needs other files or external resources to operate (False). By default (if the command is not called or if the parameter is omitted), the document is not standalone.

Compatibility note: The indentation parameter is kept for reasons of compatibility with previous versions of 4D but its use is not recommended beginning with 4D v12. From now on, to specify the indentation of the document, it is strongly recommended to use the XML SET OPTIONS command.

This command must be called one time per document and before the first XML set command in the document; otherwise, an error message will be generated.

Example  

The following code:

 SAX SET XML DECLARATION($DocRef;"UTF-16";True)

... will write this line in the document:

<<?xml version="1.0" encoding="UTF-16" standalone="yes"?>

 
PROPERTIES 

Product: 4D
Theme: XML SAX
Number: 858

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D 2004
Renamed: 4D v12
Modified: 4D v12

 
SEE ALSO 

SAX GET XML DOCUMENT VALUES