Version (XmlDoc property): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 8: | Line 8: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%curr</th> | <tr><th>%curr</th> | ||
<td>The Unicode string value of <i>doc</i>'s Version property. </td></tr> | <td>The <var>Unicode</var> string value of <i>doc</i>'s <var>Version</var> property. </td></tr> | ||
<tr><th>doc</th> | <tr><th>doc</th> | ||
<td>An XmlDoc object expression. </td></tr> | <td>An <var>XmlDoc</var> object expression. </td></tr> | ||
<tr><th>newvalue</th> | <tr><th>newvalue</th> | ||
<td>The Unicode string value to assign to <i>doc</i>'s Version property.</td></tr> | <td>The <var>Unicode</var> string value to assign to <i>doc</i>'s <var>Version</var> property.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>The initial value of the Version property is the null string. | <li>The initial value of the <var>Version</var> property is the null string. | ||
If a document is deserialized into an XmlDoc, its Version property | 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" | will be the value specified for version in the "XML declaration" | ||
of the document, if there is one. | of the document, if there is one. | ||
<li>If the Version property is the null string, the serialized | <li>If the <var>Version</var> property is the null string, the serialized | ||
form of the XmlDoc will not contain an XML declaration. | form of the <var>XmlDoc</var> will not contain an XML declaration. | ||
<li>Version may be the null string only | <li><var>Version</var> may be the null string only | ||
if the value of the Encoding and Standalone properties | if the value of the Encoding and Standalone properties | ||
are also the null string. | are also the null string. | ||
<li>The only supported values for the Version property are: | <li>The only supported values for the <var>Version</var> property are: | ||
<ul> | <ul> | ||
<li>The null string | <li>The null string | ||
Line 32: | Line 32: | ||
</ul> | </ul> | ||
<li>As of ''Sirius Mods'' version 7.3, the string values in the method syntax may include | <li>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. | only non-null EBCDIC characters that translate to <var>Unicode</var>. | ||
As of ''Sirius Mods'' version 7.6, these strings are Unicode or are converted to Unicode. | As of ''Sirius Mods'' 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 | For more information about the effects of this version 7.6 | ||
Line 40: | Line 40: | ||
===Example=== | ===Example=== | ||
The following example sets the Version and Standalone properties: | The following example sets the <var>Version</var> and Standalone properties: | ||
<p class="code">Begin | <p class="code">Begin | ||
%doc Object XmlDoc | %doc <var>Object</var> <var>XmlDoc</var> | ||
%doc:LoadXml('<a/>') | %doc:LoadXml('<a/>') | ||
%doc:Version = '1.1' | %doc:<var>Version</var> = '1.1' | ||
%doc:Standalone = 'yes' | %doc:Standalone = 'yes' | ||
%doc:Print | %doc:Print |
Revision as of 17:46, 25 January 2011
Version number in "XML declaration" (XmlDoc class)
This property indicates the 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
%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.