Lasso Soft Inc. > Home

[ xml_namedNodeMap_attr->getnameditem ]

Method

[xml_namedNodeMap_attr->getnameditem] returns the property name/data pair from a XML attribute node as a xml_attr object.

This xml_attr object can then be accessed as name/value pair similar to a map, using obj->name and obj->value.

  • Syntax
xml_namedNodeMap_attr->getnameditem(string)
Examples
  • Beginner
To get the value of a xml attribute, you can use this snipit of code.

Our test xml snip is this
If we want to get "United States" we would run it through this process.

Code

var('textXML')        = xml('<Property FormalName="Keywords" Data="United States"/>');
var('whatWeWant') = $textXML->attributes->getnameditem('Data')->value;
$whatWeWant;

Result

United States

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