Lasso Soft Inc. > Home

[ xml_element->removeattribute ]

Method

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.

  • Syntax
xml_element->removeattribute( 'attribute_name' )
Examples
  • Beginner

Remove an attribute from an xml_element

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>

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