Lasso Soft Inc. > Home

[ xml_node->nodeName ]

Method

Returns the name of the given node.

  • Syntax
xml_node->nodeName
Examples
  • Beginner

Return the name of an xml_node

This example iterates through an xml_node and displays the name of each of its child nodes.

Code

var( rhino = xml('<rhino>
     <name>Sean</name>
     <title>Grand Poobah</title>
     <location>Canada</location>
     <hairColour>Variable</hairColour>
</rhino>') )

loop($rhino->childNodes->length) => {^
      local( myNode = $rhino->childNodes->item( loop_count - 1 ) )
      'Node '+loop_count+' is '+#myNode->nodeName+'\n'
^}

Result

Node 1 is #text
Node 2 is name
Node 3 is #text
Node 4 is title
Node 5 is #text
Node 6 is location
Node 7 is #text
Node 8 is hairColour
Node 9 is #text

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft