New (XmlNodelist constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "<span style="font-size:120%; color:black"><b>Create XmlDoc/XmlNodelist object</b></span> New constructor [[Category:XmlNodelist methods|New constructo...")
 
mNo edit summary
 
(29 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Create XmlDoc/XmlNodelist object</b></span>
{{Template:XmlNodelist:New subtitle}}
[[Category:XmlDoc methods|New constructor]]
<var>New</var> creates an <var>XmlNodelist</var> object instance, taking one argument: the <var>XmlDoc</var> with which the <var>XmlNodelist</var> is associated.
[[Category:XmlNodelist methods|New constructor]]
[[Category:XmlDoc API methods]]
[[Category:System methods]]
<!--DPL?? Category:XmlDoc methods|New constructor: Create XmlDoc/XmlNodelist object-->
<!--DPL?? Category:XmlNodelist methods|New constructor: Create XmlDoc/XmlNodelist object-->
<!--DPL?? Category:XmlDoc API methods|New (XmlDoc/XmlNodelist constructor): Create XmlDoc/XmlNodelist object-->
<!--DPL?? Category:System methods|New (XmlDoc/XmlNodelist constructor): Create XmlDoc/XmlNodelist object-->
<p>
New is a member of the [[XmlDoc class|XmlDoc]] and [[XmlNodelist class|XmlNodelist]] classes.
</p>


This method creates an XmlDoc or XmlNodelist object instance.
==Syntax==
If used to create an XmlDoc, it takes no arguments.
{{Template:XmlNodelist:New syntax}}
If used to create an XmlNodelist, it takes one argument:
the XmlDoc with which the XmlNodelist is associated.
===Syntax===
  %xmldoc = New


  %xmlnlis = New(%doc)
===Syntax terms===
====Syntax Terms====
<table class="syntaxTable">
<dl>
<tr><th>%nodl</th>
<dt><i>%xmldoc</i>
<td>A declared <var>XmlNodelist</var> object variable to contain the new <var>XmlNodelist</var> object instance.</td></tr>
<dd>A declared XmlDoc object variable to contain the new XmlDoc object instance.
<dt><i>%xmlnlis</i>
<dd>A declared XmlNodelist object variable to contain the new XmlNodelist
object instance.
<dt><i>%doc</i>
<dd>A XmlDoc object variable which references
the XmlDoc with which ''%xmlnlis'' is associated.


</dl>
<tr><th><var>[%(XmlNodelist):]</var></th>
===Usage Notes===
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>.  See [[#Usage notes|Usage notes]], below, for more information about invoking an <var>XmlNodelist</var> <var>Constructor</var>.</td></tr>
 
<tr><th>doc</th>
<td>An <var>XmlDoc</var> object variable which references the <var>XmlDoc</var> with which <var class="term">%nodl</var> is associated.</td></tr>
</table>
 
==Usage notes==
<ul>
<ul>
<li>New can be invoked with no object (as in the syntax box above),
<li>As described in [[Object variables#Using New or other Constructors|Using New or other Constructors]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%nodl = new(%doc)
or alternatively as shown below, with an explicit class name
 
or with an object variable (even if that object is null):
%nodl = %(XmlNodelist):new(%doc)
<pre>
    %xmldoc = %(XmlDoc):new


    %xmlnlis = %xmlnlis:new(%doc)
%nodl = %nodl:new(%doc)
</pre>
</p></li>
<li>Besides explicit New statements, XmlNodelists can be created by other
XML methods (for example, see [[SelectNodes (XmlDoc/XmlNode function)|SelectNodes]],
[[??]] reftxt=UnionSelected refid=unionsl.,
and [[??]] reftxt=Difference refid=diff.).


An XmlDoc can only be instantiated by the New method, although an
<li>Besides explicit <var>New</var> statements, <var>XmlNodelist</var>s can be created by other XML methods (for example, see <var>[[SelectNodes (XmlDoc/XmlNode function)|SelectNodes]]</var>, <var>[[UnionSelected_(XmlNodelist_function)|UnionSelected]]</var>, and <var>[[Difference_(XmlNodelist_function)|Difference]]</var>). </li>
XmlDoc can be returned or duplicated by a method
(see [[??]] reftxt=XmlDoc refid=xdocfn. and [[??]] reftxt=Copy refid=copydoc.).
</ul>
</ul>
==See also==
{{Template:XmlNodelist:New footer}}

Latest revision as of 20:56, 15 January 2015

Create a new XmlNodelist (XmlNodelist class)

New creates an XmlNodelist object instance, taking one argument: the XmlDoc with which the XmlNodelist is associated.

Syntax

%nodl = [%(XmlNodelist):]New( doc)

Syntax terms

%nodl A declared XmlNodelist object variable to contain the new XmlNodelist object instance.
[%(XmlNodelist):] The optional class name in parentheses denotes a Constructor. See Usage notes, below, for more information about invoking an XmlNodelist Constructor.
doc An XmlDoc object variable which references the XmlDoc with which %nodl is associated.

Usage notes

  • As described in Using New or other Constructors, New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:

    %nodl = new(%doc) %nodl = %(XmlNodelist):new(%doc) %nodl = %nodl:new(%doc)

  • Besides explicit New statements, XmlNodelists can be created by other XML methods (for example, see SelectNodes, UnionSelected, and Difference).

See also