The [xml_element->getelementsbytagname] method is used to retrieve all of the elements of an xml object whose tag name matches the parameter.
The method takes one parameter, the tag name to search for.
[xml_element->getelementsbytagname] returns an [xml_nodeList] object which contains a set of [xml_element] objects.
The method returns an empty object if the specified tag name is not found.
xml_element->getelementsbytagname( 'tag_name' )
This example shows how to use the [xml_element->getelementsbytagname] method to retrieve all of the <date> elements from an XML object.
Code
var(aDay = xml('<day weekday="Monday">
<month>
<name>March</name>
<date>4</date>
<date>11</date>
<date>16</date>
<date>23</date>
<date>30</date>
</month>
</day>') )
$aDay->getelementsbytagname('date')
Result
xml_nodeList(<date>4</date>, <date>11</date>, <date>16</date>, <date>23</date>, <date>30</date>)
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 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments