The [xml_element->getattribute] method returns the contents of the named attribute of the given xml_element.
Takes one parameter, the name of the attribute. Returns an empty string if the attribute does not exist for the particular xml_element.
xml_element->getattribute( 'attribute_name' )
Use the [xml_element->getattribute] method.
This example shows haw to return the values of the day and weekday attributes of an xml_element called "vacation".
Code
var(vacationDays = xml('<vacation day="23" weekday="Friday"><employee>Sean</employee></vacation>') )
'Day is '+$vacationDays->getattribute('day')+'\n'
'Weekday is '+$vacationDays->getattribute('weekday')
Result
Day is 23 Weekday is Friday
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