Options

Getting the attribute of an xml node

ombackeombacke Member Posts: 44
I have an xml node xNode I need to get the "name" attribute value of that node
I tried xNode.attributes('name') but that does not work.
How should I do this

Comments

  • Options
    tragtrag Member Posts: 23
    Hi,

    here is an extract of a working code:
    Variables:
    Name	DataType	Subtype	Length
    XMLNode	Automation	'Microsoft XML, v3.0'.IXMLDOMNode	
    XMLAttributes	Automation	'Microsoft XML, v3.0'.IXMLDOMNamedNodeMap	
    Action     Text       30
    
    XMLAttributes := XMLNode.attributes;
    Action := XMLAttributes.getNamedItem('Action').text;
    // Now the variable 'Action' contains the value of attribute 'Action'
    
Sign In or Register to comment.