XmlDoc (XmlNode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (edits, tags and links)
Line 1: Line 1:
{{Template:XmlNode:XmlDoc subtitle}}
{{Template:XmlNode:XmlDoc subtitle}}
<var>XmlDoc</var> returns the <var>xmlDoc</var> associated with the method object <var>xmlNode</var>.


This function returns the <var>xmlDoc</var> associated with the method object.
==Syntax==
==Syntax==
{{Template:XmlNode:XmlDoc syntax}}
{{Template:XmlNode:XmlDoc syntax}}
Line 14: Line 14:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The <var>xmlDoc</var> function can be used when it is necessary, for example,
<li>The <var>xmlDoc</var> function can be used when it is necessary, for example, to get or set <var>XmlDoc</var> properties (such as <var>[[Namespace (XmlDoc property)|Namespace]]</var>) given an <var>XmlNode</var>.
to get or set <var>XmlDoc</var> properties
(such as <var>[[Namespace (XmlDoc property)|Namespace]]</var>) given an <var>XmlNode</var> or <var>XmlNodelist</var>.
</ul>
</ul>


==Examples==
==Examples==
In the following example, the <var>Namespace</var> property is temporarily changed during the execution of a local subroutine:
<ol><li>In the following example, the <var>Namespace</var> property is temporarily changed during the execution of a local subroutine:
<p class="code">local subroutine (xmlNode):display
<p class="code">local subroutine (xmlNode):display


%old enumeration xmlNamespaceSetting
  %old enumeration xmlNamespaceSetting
%old = %this:xmlDoc:namespace
  %old = %this:xmlDoc:[[Namespace (XmlDoc property)|namespace]]
%this:xmlDoc:namespace = 'Ignore'
  %this:xmlDoc:namespace = 'Ignore'
%this:selectSingleNode('*[model<"C3PO"']):Print
  %this:[[SelectSingleNode_(XmlDoc/XmlNode_function)|selectSingleNode]]('*[model<"C3PO"']):[[Print_(XmlDoc/XmlNode_subroutine)|print]]
%this:xmlDoc:namespace = %old
  %this:xmlDoc:namespace = %old


end subroutine
end subroutine
</p></ol>


==Request-Cancellation Errors==
==Request-Cancellation Errors==
Line 35: Line 34:
<li><var>xmlDoc</var> has no request cancellation errors.
<li><var>xmlDoc</var> has no request cancellation errors.
</ul>
</ul>
==See also==
==See also==
{{Template:XmlNode:XmlDoc footer}}
{{Template:XmlNode:XmlDoc footer}}

Revision as of 12:14, 10 May 2011

Get the XmlDoc associated with this node (XmlNode class)

XmlDoc returns the xmlDoc associated with the method object xmlNode.

Syntax

%doc = nod:XmlDoc

Syntax terms

%doc An xmlDoc, which will be set to point to the document associated with nod.
nod An xmlNode expression.

Usage notes

  • The xmlDoc function can be used when it is necessary, for example, to get or set XmlDoc properties (such as Namespace) given an XmlNode.

Examples

  1. In the following example, the Namespace property is temporarily changed during the execution of a local subroutine:

    local subroutine (xmlNode):display %old enumeration xmlNamespaceSetting %old = %this:xmlDoc:namespace %this:xmlDoc:namespace = 'Ignore' %this:selectSingleNode('*[model<"C3PO"']):print %this:xmlDoc:namespace = %old end subroutine

Request-Cancellation Errors

  • xmlDoc has no request cancellation errors.

See also