New (XmlNodelist constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Create XmlDoc/XmlNodelist object</b></span>
{{Template:XmlNodelist:New subtitle}}
[[Category:XmlNodelist methods|New constructor]]
[[Category:XmlNodelist methods|New constructor]]
[[Category:XmlDoc API methods]]
[[Category:XmlDoc API methods]]
<p>
<p>
This method creates an XmlNodelist object instance and takes one argument: the XmlDoc with which the XmlNodelist is associated.
This method creates an XmlNodelist object instance and takes one argument: the XmlDoc with which the XmlNodelist is associated.
===Syntax===
==Syntax==
  %xmldoc = New
{{Template:XmlNodelist:New syntax}}
 
===Syntax terms===
  %xmlnlis = New(%doc)
====Syntax Terms====
<dl>
<dl>
<dt><i>%xmldoc</i>
<dt><i>%xmldoc</i>
Line 20: Line 18:


</dl>
</dl>
===Usage Notes===
==Usage notes==
<ul>
<ul>
<li>New can be invoked with no object (as in the syntax box above),
<li>New can be invoked with no object (as in the syntax box above),

Revision as of 18:40, 22 January 2011

Create a new XmlNodelist (XmlNodelist class)

This method creates an XmlNodelist object instance and takes one argument: the XmlDoc with which the XmlNodelist is associated.

Syntax

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

Syntax terms

%xmldoc
A declared XmlDoc object variable to contain the new XmlDoc object instance.
%xmlnlis
A declared XmlNodelist object variable to contain the new XmlNodelist object instance.
%doc
A XmlDoc object variable which references the XmlDoc with which %xmlnlis is associated.

Usage notes

  • New can be invoked with no object (as in the syntax box above), or alternatively as shown below, with an explicit class name or with an object variable (even if that object is null):
        %xmldoc = %(XmlDoc):new
    
        %xmlnlis = %xmlnlis:new(%doc)
    
  • Besides explicit New statements, XmlNodelists can be created by other XML methods (for example, see SelectNodes, ?? reftxt=UnionSelected refid=unionsl., and ?? reftxt=Difference refid=diff.). An XmlDoc can only be instantiated by the New method, although an XmlDoc can be returned or duplicated by a method (see ?? reftxt=XmlDoc refid=xdocfn. and ?? reftxt=Copy refid=copydoc.).