Standalone (XmlDoc property): Difference between revisions

From m204wiki
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 string value of <i>doc</i>'s Standalone property. </td></tr>
<td>The string value of <i>doc</i>'s <var>Standalone</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 string value to assign to <i>doc</i>'s Standalone property.</td></tr>
<td>The string value to assign to <i>doc</i>'s <var>Standalone</var> property.</td></tr>
</table>
</table>


==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The only values to which you may set the Standalone property are:
<li>The only values to which you may set the <var>Standalone</var> property are:
<ul>
<ul>
<li>The null string
<li>The null string
Line 25: Line 25:


The initial value of the property is the null string.
The initial value of the property is the null string.
<li>If a document is deserialized into an XmlDoc, the value of the
<li>If a document is deserialized into an <var>XmlDoc</var>, the value of the
Standalone property of the XmlDoc
<var>Standalone</var> property of the <var>XmlDoc</var>
will be the value specified for <tt>standalone</tt> in the "XML
will be the value specified for <tt>standalone</tt> in the "XML
declaration" of the document, if there was one.
declaration" of the document, if there was one.


The possible Standalone values after deserialization are:
The possible <var>Standalone</var> values after deserialization are:
<ul>
<ul>
<li>The null string
<li>The null string
Line 36: Line 36:
<li>no
<li>no
</ul>
</ul>
<li>Standalone may be set to a non-null string only
<li><var>Standalone</var> may be set to a non-null string only
if the value of the Version property (??[[Version (XmlDoc property)|Version]])
if the value of the Version property (??[[Version (XmlDoc property)|Version]])
is also a non-null string.
is also a non-null string.
Line 42: Line 42:
===Example===
===Example===


The following example sets the Version and Standalone properties:
The following example sets the Version and <var>Standalone</var> 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.0'
%doc:Version = '1.0'
%doc:Standalone = 'yes'
%doc:<var>Standalone</var> = 'yes'
%doc:Print
%doc:Print
End
End

Revision as of 17:46, 25 January 2011

Standalone specification in "XML declaration" (XmlDoc class)


This property indicates the value of standalone in the "XML declaration," if any, at the beginning of the serialized XML document.

Syntax

%currentString = doc:Standalone doc:Standalone = newString

Syntax terms

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

Usage notes

  • The only values to which you may set the Standalone property are:
    • The null string
    • yes
    • no

    The initial value of the property is the null string.

  • If a document is deserialized into an XmlDoc, the value of the Standalone property of the XmlDoc will be the value specified for standalone in the "XML declaration" of the document, if there was one. The possible Standalone values after deserialization are:
    • The null string
    • yes
    • no
  • Standalone may be set to a non-null string only if the value of the Version property (??Version) is also a non-null string.

Example

The following example sets the Version and Standalone properties:

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

The example result follows:

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

Request-Cancellation Errors (for set method)

  • Version property is the null string, and newvalue is not the null string.
  • newvalue is invalid.

See also