Get a child node by name

Added by iNTERFACEWARE

Use node.child() to return the node of the specified name, works for all node types

Source Code
   -- create sample XML node
   local x = [[
   <patient SSN ="">
      <first-name>John</first-name>
      <last-name>Smith</last-name>
      <other-name>William</other-name>
      <other-name>Frederic</other-name>
   </patient>]]
   xmlMsg = xml.parse(x)
   trace(xmlMsg)
   
   -- get a named child node - in this case "first-name" and "last-name"
   local fname = xmlMsg.patient:child('first-name')
   local lname = xmlMsg.patient:child('last-name')
   
   -- get the 1st and 2nd "other-name"
   local oname1 = xmlMsg.patient:child('other-name')
   local oname2 = xmlMsg.patient:child('other-name',2)

Description
Use node.child() to return the node of the specified name, works for all node types