Purpose | The Node abstract class is the root class for all classes and objects in Superx++. This supports one of the aims of Superx++ which is to be tightly coupled with XML. Thus, every object in Superx++ is a node and can therefore be rendered perfectly as an XML fragment. Entire Superx++ programs as well can be rendered as XML documents. And of course they are all parseable by any XML parser. This is because Superx++ itself is based on and complies with the XML version 1.0 specification published by the W3C. | |
Format | The Node class is not actually referred to directly in the Superx++ syntax. It is implemented internally however in the run-time engine. Therefore the methods that it implements are automatically inherited and available to all classes and objects. The Node class does not implement any member variables or arrays and has no attributes. | |
The Methods of the Node Abstract Class | ||
append | ||
adds an object to become the new last child node of an object | ||
<eval object="{source object name}" member="append"> <parm type="string">{name of object to be appended}</parm> </eval>
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> </node> <node name="MyCourse">Superx++ Intro Course</node> <eval object="MyStudent" member="append"> <parm type="string">MyCourse</parm> </eval>
This code results in the MyStudent node being of the following form: |
||
cdata | ||
returns the CDATA sections of an object | ||
<eval object="{source object name}" member="cdata" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <![CDATA[ my 1st... ]]> <![CDATA[ my 2nd... ]]> <Phone>1-800-BAD-MUSC</Phone> <![CDATA[ my 3rd... ]]> <Address>2400 MyStreet, Anytown</Address> <![CDATA[ my 4th... ]]> <![CDATA[ my 5th... ]]> </node> <xout>CDATA for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="cdata" /> </xout> <xout>\r\nCDATA for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="cdata" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for CDATA section parsing by the Superx++ run-time engine is that the CDATA sections that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the CDATA sections before and after it. The same applies to comments. |
||
child | ||
returns the specified child node of an object | ||
<eval object="{parent object name}" member="node"> <parm type="string">{name of child}</parm> </eval>
where:
<eval object="{parent object name}" member="node">
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>The child is\r\n</xout> <xout> <eval object="MyStudent" member="child"> <parm type="string">Phone</parm> </eval> </xout>
This code results in the following text being sent to the output stream:
If we change the <eval> statement nested within the <xout> statement to the following:
then the text sent to the output stream will be: The reason for this is that the <eval> statement will use the includepath attribute default of false to execute. In that case any node trees with only one terminal node will return just the value of the terminal node. To get the actual node tree you will need to set includepath to true. You can also use the sibling number to get the child object as shown below:
<node name="MyStudent">
This code results in the following text being sent to the output stream: |
||
comments | ||
returns the comments of an object | ||
<eval object="{source object name}" member="comments" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <!-- my 1st... --> <!-- my 2nd... --> <Phone>1-800-BAD-MUSC</Phone> <!-- my 3rd... --> <Address>2400 MyStreet, Anytown</Address> <!-- my 4th... --> <!-- my 5th... --> </node> <xout>comments for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="comments" /> </xout> <xout>\r\ncomments for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="comments" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for comments section parsing by the Superx++ run-time engine is that the comments that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the comments before and after it. The same applies to CDATA sections. |
||
constructor | ||
the constructor method does nothing by default-- over-ride it in your class to perform resource allocation and other necessary initialization activities before instantiation of an object is complete | ||
The constructor method is not typically called directly by the programmer. Rather it is automatically invoked when an object is instantiated. The default constructor method takes no parameters. You can however, overload the constructor method in your classes by implementing multiple constructor methods with varying number of parameters.
|
||
<class name="XPerson" inherit=""> <construct> <scope type="public"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </scope> </construct> <scope type="public"> <func name="constructor" type="void"> <body> <xout>\r\nIn the constructor for </xout> <xout><eval object="this" member="tag" /></xout> </body> </func> <func name="constructor" type="void"> <parm type="string" name="parm1" /> <body> <xout>\r\nIn the constructor: parm1 = </xout> <xout><eval object="parm1" /></xout> <xout> for </xout> <xout><eval object="this" member="tag" /></xout> </body> </func> </scope> </class> <node name="MyStudent" class="XPerson"> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <node name="MyPal" class="XPerson"> <parm type="string" name="parm1">100</parm> </node> <xout>\r\nMemory is\r\n</xout> <xout> <eval object="mem" includepath="true" /> </xout>
This code results in the following text being written to the output stream: The example above illustrates overloading of the constructor method in the XPerson class. It also illustrates customized instantiation in the case of the MyStudent object. Notice how the Schools child object does not exist in XPerson but exists in the instantiated MyStudent object. This shows an individual mutation in MyStudent that does not exist in the class it belongs to. Also, notice how the parameter for the constructor method is passed using the <node> statement for MyPal. This <parm> node is consumed by the constructor method and does not appear in the instantiated MyPal object. <parm> is a special node in the <node> statement and is used for the constructor methods-- it never appears in the instantiated object produced by the <node> statement. |
||
copy | ||
copies an object's value, descendants, attributes and members to another object | ||
<eval object="{source object name}" member="copy"> <parm type="string">{name of object to be copied}</parm> </eval>
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> </node> <node name="MyCourse">Superx++ Intro Course</node> <eval object="MyStudent" member="copy"> <parm type="string">MyCourse</parm> </eval>
This code results in the MyStudent node being of the following form: |
||
count/numchildren | ||
returns the number of children of an object | ||
<eval object="{source object name}" member="count" /> <eval object="{source object name}" member="numchildren" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent has </xout> <xout> <eval object="MyStudent" member="count" /> </xout> <xout> children</xout>
This code results in the following text being written to the output stream: |
||
delete | ||
deletes an object and all its descendants | ||
<eval object="{object name}" member="delete" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <eval object="MyStudent/Schools" member="delete" /> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
deletechild | ||
deletes a specific child object of an object | ||
<eval object="{object name}" member="deletechild"> parm type="string">{child name}</parm> </eval>
where:
<eval object="{object name}" member="deletechild">
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <eval object="MyStudent" member="deletechild"> <parm type="int">3</parm> </eval> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
deletechildren | ||
deletes an object's descendant nodes | ||
<eval object="{object name}" member="deletechildren" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <eval object="MyStudent/Schools" member="deletechildren" /> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
deletechildrenexcept | ||
deletes all the descendants of an object except a specific child and its descendants | ||
<eval object="{object name}" member="deletechildrenexcept"> parm type="string">{child name}</parm> </eval>
where:
<eval object="{object name}" member="deletechildrenexcept">
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <eval object="MyStudent" member="deletechildrenexcept"> <parm type="int">3</parm> </eval> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
deleteleavechildren | ||
deletes an object and inserts its children in its stead as children of its parent object | ||
<eval object="{object name}" member="deleteleavechildren" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <eval object="MyStudent/Schools" member="deleteleavechildren" /> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
destructor | ||
the destructor method does nothing by default-- over-ride it in your class to perform resource deallocation and other necessary activities before deletion of an object is complete | ||
The destructor method is not typically called directly by the programmer. Rather it is automatically invoked when an object is deleted. The destructor method takes no parameters.
|
||
<class name="XPerson" inherit=""> <construct> <scope type="public"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </scope> </construct> <scope type="public"> <func name="destructor" type="void"> <body> <xout>\r\nIn the destructor</xout> </body> </func> </scope> </class> <node name="MyStudent" class="XPerson"> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <xout>Memory is\r\n</xout> <xout> <eval object="mem" includepath="true" /> </xout> <eval object="MyStudent" member="delete" /> <xout>\r\nMemory after delete is\r\n</xout> <xout> <eval object="mem" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
empty | ||
deletes all descendants of an object as well its value, attributes and members | ||
<eval object="{source object name}" member="empty" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <eval object="MyStudent" member="empty" /> <xout>MyStudent is\r\n</xout> <xout> <eval object="MyStudent" /> </xout>
This code results in the following text being written to the output stream: |
||
firstsibling | ||
returns the first child of the parent of an object-- i.e. the child whose sibling number = 0 | ||
<eval object="{source object name}" member="firstsibling" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent's first child is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="firstsibling" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
insert | ||
inserts an object to become a new child node of an object at an specified position |
<eval object="{source object name}" member="insert"> <parm type="string">{name of object to be shifted}</parm> <parm type="string">{name of object to be inserted}</parm> </eval>
where:
<eval object="{source object name}" member="insert">
where:
|
|
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <node name="MyCourse">Superx++ Intro Course</node> <eval object="MyStudent" member="insert"> <parm type="string">Phone</parm> <parm type="string">MyCourse</parm> </eval>
This code results in the MyStudent node being of the following form:
<node name="MyStudent">
This code results in the MyStudent node being of the following form:
|
||
isempty | ||
returns true if an object has no value and no descendant nodes | ||
<eval object="{source object name}" member="isempty" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent's isempty status is </xout> <xout> <eval object="MyStudent" member="isempty" /> </xout> <eval object="MyStudent" member="empty" /> <xout>MyStudent's isempty status is </xout> <xout> <eval object="MyStudent" member="isempty" /> </xout>
This code results in the following text being written to the output stream: |
||
lastsibling | ||
returns the last child of the parent of an object-- i.e. the child with the highest sibling number | ||
<eval object="{source object name}" member="lastsibling" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent's last child is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="lastsibling" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
nextsibling | ||
returns the next child of the parent of an object-- i.e. the child with the sibling number 1 higher than that of the object | ||
<eval object="{source object name}" member="nextsibling" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's next child is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="nextsibling" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
parent | ||
returns the parent containing object of an object | ||
<eval object="{child object name}" member="parent" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <xout>MyStudent/Schools/university's parent is\r\n</xout> <xout> <eval object="MyStudent/Schools/university" member="parent" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
path | ||
returns the path of an object | ||
<eval object="{object name}" member="path" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <xout>MyStudent/Schools/university's path is\r\n</xout> <xout> <eval object="MyStudent/Schools/university" member="path" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
postcdata | ||
returns the succeeding CDATA sections of an object-- put another way, the post-CDATA sections of an object | ||
<eval object="{source object name}" member="postcdata" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <![CDATA[ my 1st... ]]> <![CDATA[ my 2nd... ]]> <Phone>1-800-BAD-MUSC</Phone> <![CDATA[ my 3rd... ]]> <Address>2400 MyStreet, Anytown</Address> <![CDATA[ my 4th... ]]> <![CDATA[ my 5th... ]]> </node> <xout>post-CDATA for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="postcdata" /> </xout> <xout>\r\npost-CDATA for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="postcdata" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for CDATA section parsing by the Superx++ run-time engine is that the CDATA sections that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the CDATA sections before and after it. The same applies to comments. |
||
postcomments | ||
returns the succeeding comments of an object-- put another way, the post-comments of an object | ||
<eval object="{source object name}" member="postcomments" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <!-- my 1st... --> <!-- my 2nd... --> <Phone>1-800-BAD-MUSC</Phone> <!-- my 3rd... --> <Address>2400 MyStreet, Anytown</Address> <!-- my 4th... --> <!-- my 5th... --> </node> <xout>post-comments for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="postcomments" /> </xout> <xout>\r\npost-comments for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="postcomments" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for comments parsing by the Superx++ run-time engine is that the comments that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the comments before and after it. The same applies to CDATA sections. |
||
precdata | ||
returns the preceding CDATA sections of an object-- put another way, the pre-CDATA sections of an object | ||
<eval object="{source object name}" member="precdata" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <![CDATA[ my 1st... ]]> <![CDATA[ my 2nd... ]]> <Phone>1-800-BAD-MUSC</Phone> <![CDATA[ my 3rd... ]]> <Address>2400 MyStreet, Anytown</Address> <![CDATA[ my 4th... ]]> <![CDATA[ my 5th... ]]> </node> <xout>pre-CDATA for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="precdata" /> </xout> <xout>\r\npre-CDATA for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="precdata" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for CDATA section parsing by the Superx++ run-time engine is that the CDATA sections that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the CDATA sections before and after it. The same applies to comments. |
||
precomments | ||
returns the preceding comments of an object-- put another way, the pre-comments of an object | ||
<eval object="{source object name}" member="precomments" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <!-- my 1st... --> <!-- my 2nd... --> <Phone>1-800-BAD-MUSC</Phone> <!-- my 3rd... --> <Address>2400 MyStreet, Anytown</Address> <!-- my 4th... --> <!-- my 5th... --> </node> <xout>pre-comments for Phone is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="precomments" /> </xout> <xout>\r\npre-comments for Address is\r\n</xout> <xout> <eval object="MyStudent/Address" member="precomments" /> </xout>
This code results in the following text being written to the output stream on separate lines: The default for comments parsing by the Superx++ run-time engine is that the comments that precede a node will belong to that node. The exception occurs for the last node in a level of the tree, in which case it gets the comments before and after it. The same applies to CDATA sections. |
||
prepend | ||
adds an object to become the new first child node of an object |
<eval object="{source object name}" member="prepend"> <parm type="string">{name of object to be prepended}</parm> </eval>
where: |
|
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> </node> <node name="MyCourse">Superx++ Intro Course</node> <eval object="MyStudent" member="prepend"> <parm type="string">MyCourse</parm> </eval>
This code results in the MyStudent node being of the following form: |
||
prevsibling/priorsibling | ||
returns the previous child of the parent of an object-- i.e. the child with the sibling number 1 lower than that of the object | ||
<eval object="{source object name}" member="prevsibling" /> <eval object="{source object name}" member="priorsibling" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's prev child is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="prevsibling" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
root | ||
returns the root container object of an object | ||
<eval object="{source object name}" member="root" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's root is\r\n</xout> <xout> <eval object="MyStudent/Phone" member="root" includepath="true" /> </xout>
This code results in the following text being written to the output stream: |
||
save | ||
serializes an object as XML and saves it to a file-- similar to the <save> statement | ||
<eval object="{source object name}" member="save"> <parm type="string">{file path}</parm> </eval
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent's save status is </xout> <xout> <eval object="MyStudent" member="save"> C:\\MyDir\\MyFile.xml </eval> </xout>
If the save operation succeeded then the following text being written to the output stream: If on the otherhand the save operation failed, the returned value of the save method would have been false |
||
sibling | ||
returns the specified sibling of an object | ||
<eval object="{object name}" member="sibling"> <parm type="int">{sibling number}</parm> </eval>
where:
<eval object="{object name}" member="sibling">
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <xout>MyStudent/Schools' 1st sibling is\r\n</xout> <xout> <eval object="MyStudent/Schools" member="sibling" includesibling="true"> <parm type="int">0</parm> </eval> </xout>
This code results in the following text being written to the output stream: |
||
siblingnumber | ||
returns the sibling number of an object | ||
<eval object="{object name}" member="siblingnumber" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's sibling number is</xout> <xout> <eval object="MyStudent/Phone" member="siblingnumber" /> </xout>
This code results in the following text being written to the output stream: |
||
tag | ||
returns the tag/name of an object | ||
<eval object="{source object name}" member="tag" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's tag is </xout> <xout> <eval object="MyStudent/Phone" member="tag" /> </xout>
This code results in the following text being written to the output stream: |
||
treestructuresame | ||
compares the object trees of two objects using specific criteria for sameness | ||
<eval object="{object name}" member="treestructuresame"> parm type="string">{compare object name}</parm> parm type="string">{criteria}</parm> </eval>
where: |
||
The criteria for treestructuresame comparisons | ||
The number of children at each level of the object trees must be the same in all cases | ||
node | compares the tags/names of the two objects and the tags/names of all their descendants-- returns true if they are the same | |
var | compares the names of the member variables of the two objects and the names of the member variables of all their descendants-- returns true if they are the same | |
arr | compares the names of the member arrays of the two objects and the names of the member arrays of all their descendants-- returns true if they are the same | |
attr | compares the names of the attributes of the two objects and the names of the attributes of all their descendants-- returns true if they are the same | |
value | compares the values of the two objects and the values of all their descendants-- returns true if they are the same | |
<node name="MyStudent"> <Name var_bool_full="true">Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> <Schools> <university>Cambridge</university> <high>Kingston</high> </Schools> </node> <node name="MyEmployee"> <Name var_bool_full="false">Kioko Mulwa</Name> <Job>Engineer</Job> <Company>TeK Systems</Company> <Projects> <App>HR System 1.9</App> <Documentation>none</Documentation> </Projects> </node> <xout>Nodes same? </xout> <xout> <eval object="MyStudent" member="treestructuresame"> <parm type="string">MyEmployee</parm> <parm type="string">node</parm> </eval> </xout> <xout>\r\nVariables same? </xout> <xout> <eval object="MyStudent" member="treestructuresame"> <parm type="string">MyEmployee</parm> <parm type="string">var</parm> </eval> </xout> <node name="MyClone" /> <eval object="MyClone" member="copy"> <parm type="string">MyStudent</parm> </eval> <xout>\r\nMyStudent same as MyClone? </xout> <xout> <eval object="MyStudent" member="treestructuresame"> <parm type="string">MyClone</parm> <parm type="string">node,var,arr,attr,value</parm> </eval> </xout> <xout>\r\nMyStudent/Schools same as MyClone/Schools? </xout> <xout> <eval object="MyStudent/Schools" member="treestructuresame"> <parm type="string">MyClone/Schools</parm> <parm type="string">node,var,arr,attr,value</parm> </eval> </xout>
This code results in the following text being written to the output stream: |
||
value | ||
returns the value of an object | ||
<eval object="{object name}" member="value" />
where: |
||
<node name="MyStudent"> <Name>Johnnie B. Goode</Name> <Phone>1-800-BAD-MUSC</Phone> <Address>2400 MyStreet, Anytown</Address> </node> <xout>MyStudent/Phone's value is </xout> <xout> <eval object="MyStudent/Phone" member="value" /> </xout> <xout>\r\nMyStudent's value is\r\n</xout> <xout> <eval object="MyStudent" member="value" /> </xout>
This code results in the following text being written to the output stream: |