XmlDoc (XmlNodelist function): Difference between revisions

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


==Syntax==
==Syntax==
Line 8: Line 7:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%doc</th>
<tr><th>%doc</th>
<td>An <var>XmlDoc</var>, which will be set to point to the document associated with <var class="term">nodl</var>. </td></tr>
<td>An <var>XmlDoc</var>, which will be set to point to the document associated with <var class="term">nodl</var>.</td></tr>
<tr><th>nodl</th>
<tr><th>nodl</th>
<td>An <var>XmlNodeList</var> expression.</td></tr>
<td>An <var>XmlNodeList</var> expression.</td></tr>
</table>
</table>


Line 19: Line 18:


==Examples==
==Examples==
<ol><li>You can use the <var>XmlDoc</var> function to access the Root node (and then, optionally, to use an <var>[[XPath]]</var> expression which is in effect an absolute expression) with an empty <var>xmlNodelist</var>, as in the following example:
<ol><li>You can use <var>XmlDoc</var> to access the <var>Root</var> node (and then, optionally, to use an <var>[[XPath]]</var> expression which is in effect an absolute expression) with an empty <var>xmlNodelist</var>, as in the following example:
<p class="code">local subroutine (xmlNodelist):display
<p class="code">local subroutine (xmlNodelist):display
   if %this:[[Count_(XmlNodelist_function)|count]] eq 0 then
   if %this:[[Count_(XmlNodelist_function)|count]] eq 0 then

Revision as of 11:35, 11 May 2011

Get the XmlDoc associated with this nodelist (XmlNodelist class)

XmlDoc returns the xmlDoc associated with the method object XmlNodelist.

Syntax

%doc = nodl:XmlDoc

Syntax terms

%doc An XmlDoc, which will be set to point to the document associated with nodl.
nodl 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

  1. You can use XmlDoc 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.

See also