Lasso Soft Inc. > Home

[ xml_node->firstChild ]

Method

The [xml_node->firstChild] method returns the first child element of the given node in its entirety. 

The returned object has the type xml_element.

  • Syntax
xml_node->firstChild
Examples
  • Beginner

To retrieve the first child element of an xml_node

This example uses the [xml_node->firstChild] method to retrieve the "data" element of the "month" node.

Code

var(aMonth = xml('<month>
    <data>
        <name>March</name>
        <date type="lastDay">31</date>
    </data>
    <date>4</date>
    <date>11</date>
    <date>16</date>
    <date>23</date>
    <date>30</date>
</month>') )

$aMonth->firstChild

Result

<data>
   <name>March</name>
   <date type="lastDay">31</date>
</data>

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