Version (XmlDoc property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 16: Line 16:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The initial value of the <var>Version</var> property is the <var>null</var> string.  If a document is deserialized into an <var>XmlDoc</var>, its <var>Version</var> property will be the value specified for version in the "XML declaration" of the document, if there is one.
<li>The initial value of the <var>Version</var> property is the null string.  If a document is deserialized into an <var>XmlDoc</var>, its <var>Version</var> property will be the value specified for version in the "XML declaration" of the document, if there is one.
<li>If the <var>Version</var> property is the <var>null</var> string, the serialized form of the <var>XmlDoc</var> will not contain an XML declaration.
<li>If the <var>Version</var> property is the null string, the serialized form of the <var>XmlDoc</var> will not contain an XML declaration.
<li><var>Version</var> may be the <var>null</var> string only if the value of the <var>[[Encoding_(XmlDoc_property)|Encoding]]</var> and <var>[[Standalone_(XmlDoc_property)|Standalone]]</var> properties are also the <var>null</var> string.
<li><var>Version</var> may be the null string only if the value of the <var>[[Encoding_(XmlDoc_property)|Encoding]]</var> and <var>[[Standalone_(XmlDoc_property)|Standalone]]</var> properties are also the null string.
<li>The only supported values for the <var>Version</var> property are:
<li>The only supported values for the <var>Version</var> property are:
<ul>
<ul>
<li>The <var>null</var> string
<li>The null string
<li><code>1.0</code>
<li><code>1.0</code>
<li><code>1.1</code> (if <var class="product">[[Sirius Mods]]</var> Version 7.5 or higher)
<li><code>1.1</code> (if <var class="product">[[Sirius Mods]]</var> Version 7.5 or higher)
</ul>
</ul>
<li>As of <var class="product">Sirius Mods</var> Version 7.3, the string values in the method syntax may include only non-null EBCDIC characters that translate to <var>Unicode</var>.  As of <var class="product">Sirius Mods</var> Version 7.6, these strings are <var>Unicode</var> or are converted to <var>Unicode</var>.  For more information about the effects of this Version 7.6 change, see [[XmlDoc API#Strings and Unicode with the XmlDoc API|"Strings and Unicode with the XmlDoc API"]].
<li>As of <var class="product">Sirius Mods</var> Version 7.3, the string values in the method syntax may include only non-null EBCDIC characters that translate to Unicode.  As of <var class="product">Sirius Mods</var> Version 7.6, these strings are <var>Unicode</var> or are converted to <var>Unicode</var>.  For more information about the effects of this Version 7.6 change, see [[XmlDoc API#Strings and Unicode with the XmlDoc API|"Strings and Unicode with the XmlDoc API"]].
</ul>
</ul>


==Example==
==Example==
<ol><li>
The following example sets the <var>Version</var> and <var>Standalone</var> properties:
The following example sets the <var>Version</var> and <var>Standalone</var> properties:
<p class="code">begin
<p class="code">begin
Line 42: Line 41:
<p class="output"><?xml version="1.1" standalone="yes"?>
<p class="output"><?xml version="1.1" standalone="yes"?>
<a/>
<a/>
</p></ol>
</p>


==Request-cancellation errors (for set method)==
==Request-cancellation errors (for set method)==

Revision as of 19:52, 6 June 2011

Version number in "XML declaration" (XmlDoc class)

Version sets or returns value of version in the "XML declaration," if any, at the beginning of the serialized XML document.

Syntax

%currentString = doc:Version doc:Version = newString

Syntax terms

%currentString The Unicode string value of doc's Version property.
doc An XmlDoc object expression.
newString 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.0
    • 1.1 (if Sirius Mods Version 7.5 or higher)
  • 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 with the XmlDoc API".

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 newString is the null string.
  • newString is invalid.

See also

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