GetAttributeName method: Incoming Business Interlink class

Syntax

GetAttributeName(attributenumber)

Description

The GetAttributeName method gets the name of an attribute within an XML element referenced by a BiDocs object.

Parameters

Parameter Description

attributenumber

Number. The index number of the attribute.

Returns

String. The name of the attribute.

Example

Here is a set of XML request code.

<?xml version="1.0"?> 
   <postreq> 
      <email>joe_blow@example.com</email> 
      <location scenery="great" density="low" blank="eh?"> 
         <city>San Rafael</city> 
         <state>CA</state> 
         <zip>94522</zip> 
         <country>US</country> 
      </location> 
   </postreq>

Here is the PeopleCode that gets the name of the second attribute in the location node. &attrName is density.

Local BIDocs &rootInDoc, postreqDoc, &locationDoc; 
Local string &blob, &attrName; 
&blob = %Request.GetContentBody(); 
&rootInDoc = GetBiDoc(&blob); 
&postreqDoc = &rootInDoc.GetNode("postreq"); 
&locationDoc = &postreqDoc.GetNode("location"); 
&attrName = &locationDoc.GetAttributeName(2);