XmlDoc (XmlNodelist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>XmlDoc object of XmlNode or XmlNodelist</b></span>
<span style="font-size:120%; color:black"><b>XmlDoc object of XmlNode or XmlNodelist</b></span>
[[Category:XmlNode methods|XmlDoc function]]
[[Category:XmlNodelist methods|XmlDoc function]]
[[Category:XmlNodelist methods|XmlDoc function]]
[[Category:XmlDoc API methods]]
[[Category:XmlDoc API methods]]
<!--DPL?? Category:XmlNode methods|XmlDoc function: XmlDoc object of XmlNode or XmlNodelist-->
<!--DPL?? Category:XmlNodelist methods|XmlDoc function: XmlDoc object of XmlNode or XmlNodelist-->
<!--DPL?? Category:XmlDoc API methods|XmlDoc (XmlNode/XmlNodelist function): XmlDoc object of XmlNode or XmlNodelist-->
<!--DPL?? Category:System methods|XmlDoc (XmlNode/XmlNodelist function): XmlDoc object of XmlNode or XmlNodelist-->
<p>
XmlDoc is a member of the [[XmlNode class|XmlNode]] and [[XmlNodelist class|XmlNodelist]] classes.
</p>


This function returns the XmlDoc associated with the method object.
This function returns the <var>xmlDoc</var> associated with the method object.
===Syntax===
===Syntax===
   %doc = nod:XmlDoc
   %doc = nod:XmlDoc
Line 31: Line 23:
===Usage Notes===
===Usage Notes===
<ul>
<ul>
<li>The XmlDoc function can be used when it is necessary, for example,
<li>The <var>xmlDoc</var> function can be used when it is necessary to get or set <var>xmlDoc</var> properties
to get or set XmlDoc properties
(such as <var>[[Namespace (XmlDoc property)|namespace]]</var>) given an <var>xmlNodelist</var>.
(such as ??[[Namespace (XmlDoc property)|Namespace]]) given an XmlNode or XmlNodelist.
</ul>
</ul>


===Examples===
===Examples===
<ul>
You can use the XmlDoc function to access the Root node (and then, optionally, to use an XPath expression which is in effect an absolute expression) with an empty <var>xmlNodelist</var>, as in the following example:
<li>In the following example, the Namespace property is temporarily changed
<p class="code">local subroutine (xmlNodelist):display
during the execution of a subroutine:
 
<pre>
if %this:count eq 0 then
    Subroutine disp(%n Object XmlNode)
  printText Nodelist empty, here is the document:
    %old Enumeration XmlNamespaceSetting
  %this:xmlDoc:print
    %old = %n:XmlDoc:Namespace
else
    %n:XmlDoc:Namespace = 'Ignore'
  ...
    %n:SelectSingleNode('*[model<"C3PO"']):Print
end if
    %n:XmlDoc:Namespace = %old
</p>
    End Subroutine
</pre>
<li>You can also use the XmlDoc function to access the Root node
(and then, optionally, to use an XPath expression which is
in effect an absolute expression)
with an empty XmlNodelist, as in the following example:
<pre>
    Subroutine disp(%l Object XmlNodelist)
    If %l:Count EQ 0 Then
      Print 'Nodelist empty; here is document:'
      %l:XmlDoc:Print
    Else
      ...
</pre>
</ul>
===Request-Cancellation Errors===
===Request-Cancellation Errors===
<ul>
<ul>
<li>XmlDoc has no request cancellation errors.
<li>XmlDoc has no request cancellation errors.
</ul>
</ul>

Revision as of 15:31, 23 January 2011

XmlDoc object of XmlNode or XmlNodelist

This function returns the xmlDoc associated with the method object.

Syntax

  %doc = nod:XmlDoc
  %doc = nlis:XmlDoc

Syntax Terms

%doc
An XmlDoc, which will be set to point to the document associated with nod or nlis.
nod
An XmlNode expression.
nlis
An XmlNodelist expression.

Usage Notes

  • The xmlDoc function can be used when it is necessary to get or set xmlDoc properties (such as namespace) given an xmlNodelist.

Examples

You can use the XmlDoc function to access the Root node (and then, optionally, to use an XPath expression which is in effect an absolute expression) with an empty xmlNodelist, as in the following example:

local subroutine (xmlNodelist):display if %this:count eq 0 then printText Nodelist empty, here is the document: %this:xmlDoc:print else ... end if

Request-Cancellation Errors

  • XmlDoc has no request cancellation errors.