Standalone (XmlDoc property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (edits, tags and links)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:XmlDoc:Standalone subtitle}}
{{Template:XmlDoc:Standalone subtitle}}
<var>Standalone</var> sets or return the value of <var>standalone</var> in the "XML declaration," if any, at the beginning of the serialized XML document.
<var>Standalone</var> sets or returns the value of <var>standalone</var> in the "XML declaration," if any, at the beginning of the serialized XML document.


==Syntax==
==Syntax==
Line 13: Line 13:
<td>The string value to assign to <var class="term">doc</var>'s <var>Standalone</var> property.  The only values to which you may set the <var>Standalone</var> property are:
<td>The string value to assign to <var class="term">doc</var>'s <var>Standalone</var> property.  The only values to which you may set the <var>Standalone</var> property are:
<ul>
<ul>
<li>The <var>null</var> string
<li>The null string
<li><code>yes</code>
<li><var>Yes</var>
<li><code>no</code>
<li><var>No</var>
</ul></td></tr>   
</ul></td></tr>   
</table>
</table>


==Usage notes==
==Usage notes==
<ul><li>The initial value of <var>Standalone</var> is the <var>null</var> string.
<ul><li>The initial value of <var>Standalone</var> is the null string.
<li>If a document is deserialized into an <var>XmlDoc</var>, the value of <var>Standalone</var> of the <var>XmlDoc</var> will be the value specified for <var>standalone</var> in the "XML
<li>If a document is deserialized into an <var>XmlDoc</var>, the value of <var>Standalone</var> of the <var>XmlDoc</var> will be the value specified for <code>standalone</code> in the "XML
declaration" of the document, if there was one.
declaration" of the document, if there was one.
<p>
<p>
The possible <var>Standalone</var> values after deserialization are:
The possible <var>Standalone</var> values after deserialization are:
<ul>
<ul>
<li>The <var>null</var> string
<li>The null string
<li><code>yes</code>
<li><var>Yes</var>
<li><code>no</code>
<li><var>No</var>
</ul></p>
</ul></p>
<li><var>Standalone</var> may be set to a non-null string only if the value of the <var>[[Version (XmlDoc property)|Version]]</var> property is also a non-null string.
<li><var>Standalone</var> may be set to a non-null string only if the value of the <var>[[Version (XmlDoc property)|Version]]</var> property is also a non-null string.
Line 34: Line 34:


==Examples==
==Examples==
<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 47: Line 46:
<p class="output"><?xml version="1.0" standalone="yes"?>
<p class="output"><?xml version="1.0" standalone="yes"?>
<a/>
<a/>
</p></ol>
</p>


==Request-Cancellation Errors/ (for set method)==
==Request-cancellation errors (for set method)==
This list is not exhaustive: it does <i>not</i> include all the errors that are request  cancelling.
<ul>
<ul>
<li>The <var>Version</var> property is the null string, and <var class="term">newString</var> is not the null string.
<li>The <var>Version</var> property is the null string, and the <var class="term">newString</var> argument is not the null string.
<li><var class="term">newstring</var> is invalid.
<li><var class="term">newString</var> is invalid.
</ul>
</ul>


==See also==
==See also==
{{Template:XmlDoc:Standalone footer}}
{{Template:XmlDoc:Standalone footer}}

Latest revision as of 21:05, 3 March 2014

Standalone specification in "XML declaration" (XmlDoc class)

Standalone sets or returns 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

%currentString The string value of doc's Standalone property.
doc An XmlDoc object expression.
newString The string value to assign to doc's Standalone property. The only values to which you may set the Standalone property are:
  • The null string
  • Yes
  • No

Usage notes

  • The initial value of Standalone is the null string.
  • If a document is deserialized into an XmlDoc, the value of Standalone 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 is also a non-null string.

Examples

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)

This list is not exhaustive: it does not include all the errors that are request cancelling.

  • The Version property is the null string, and the newString argument is not the null string.
  • newString is invalid.

See also