XmlDoc (XmlNode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 16: Line 16:
<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
to get or set <var>xmlDoc</var> properties
(such as ??[[Namespace (<var>xmlDoc</var> property)|Namespace]]) given an XmlNode or XmlNodelist.
(such as ??[[Namespace (<var>xmlDoc</var> property)|<var>Namespace</var>]]) given an <var>Xml</var>Node or <var>Xml</var>Nodelist.
</ul>
</ul>


==Examples==
==Examples==
In the following example, the Namespace property is temporarily changed during the execution of a local subroutine:
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 xml<var>Namespace</var>Setting
%old = %this:xmlDoc:namespace
%old = %this:xmlDoc:namespace
%this:xmlDoc:namespace = 'Ignore'
%this:xmlDoc:namespace = 'Ignore'
%this:selectSingleNode('*[model<"C3PO"']):Print
%this:selectSingleNode('*[model<"C3PO"']):<var>Print</var>
%this:xmlDoc:namespace = %old
%this:xmlDoc:namespace = %old



Revision as of 17:46, 25 January 2011

Get the XmlDoc associated with this node (XmlNode class)


This function returns the xmlDoc associated with the method object.

Syntax

%doc = nod:XmlDoc

Syntax terms

%object 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 (xmlDoc property)|Namespace]]) given an XmlNode or XmlNodelist.

Examples

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