The [xml_element->removeattribute] method removes the named attribute from a given xml_element.
The method takes one parameter, the name of the attribute to be removed. If the named attribute is not present in the element the method returns no error.
xml_element->removeattribute( 'attribute_name' )
This example shows how to use the [xml_element->removeattribute] method to remove the "weekday" attribute from the "vacation" xml_element
Code
var(vacationDays = xml('<vacation day="21" weekday="Friday" month="March">
<employee>Sean</employee>
</vacation>') )
$vacationDays->removeattribute('weekday')
$vacationDays
Result
<vacation day="21" month="March"> <employee>Sean</employee> </vacation>
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