Version (XmlDoc property)

From m204wiki
Revision as of 00:33, 7 December 2010 by Admin (talk | contribs) (1 revision)
Jump to navigation Jump to search

Version number in "XML declaration"

Version is a member of the XmlDoc class.

This property indicates the value of version in the “XML declaration,” if any, at the beginning of the serialized XML document.

Syntax

  %curr = doc:Version
  doc:Version = newvalue

Syntax Terms

%curr
The Unicode string value of doc's Version property.
doc
An XmlDoc object expression.
newvalue
The Unicode string value to assign to doc's Version property.

Usage Notes

  • The initial value of the Version property is the null string. If a document is deserialized into an XmlDoc, its Version property will be the value specified for version in the “XML declaration” of the document, if there is one.
  • If the Version property is the null string, the serialized form of the XmlDoc will not contain an XML declaration.
  • Version may be the null string only if the value of the Encoding and Standalone properties are also the null string.
  • The only supported values for the Version property are:
    • The null string
    • 1.1 (if Sirius Mods version 7.5 or higher) or 1.0.
  • As of Sirius Mods version 7.3, the string values in the method syntax may include only non-null EBCDIC characters that translate to Unicode. As of Sirius Mods version 7.6, these strings are Unicode or are converted to Unicode. For more information about the effects of this version 7.6 change, see Strings and Unicode.

Example

The following example sets the Version and Standalone properties:

    Begin
    %doc Object XmlDoc
    %doc:LoadXml('<a/>')
    %doc:Version = '1.1'
    %doc:Standalone = 'yes'
    %doc:Print
    End

The example result follows:

    <?xml version="1.1" standalone="yes"?>
    <a/>

Request-Cancellation Errors (for set method)

  • Encoding or Standalone property is not the null string, and newvalue is the null string.
  • newvalue is invalid.


See Also

  • These methods control whether to display the version: ??Print and ??Xml.