• Murali Raghavan
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

I have a requirement to check if a XML paramter Node contians certain text and if so to replace it.  

 

With the following code for example.  I would need to replace the content I get via 

arrayOfActionTypeNode.getText()

 

for(String parameterName : this.paramterMap.keySet()) {
       arrayOfFieldTypeNode = this.paramterMap.get(parameterName).toXML(arrayOfFieldTypeNode);
        if (parameterName.contains('AccountID')) {
            System.debug('AccountIDVal=' + this.paramterMap.get(parameterName));
            System.debug('arrayOfFieldTypeNode=' + arrayOfFieldTypeNode);
            System.debug('nameVal=' + arrayOfFieldTypeNode.getName());
            System.debug('textVal=' + arrayOfFieldTypeNode.getText());
     }
}

 

 

 

I tried it with 

 

arrayOfActionTypeNode.getText().put('test') but a similar function is not available. 

 

If I want to update the text in the parameter do I need to delete the attribute or child first via removeAttribute/removeChild and create a new one, or is there a simpler way of doing this?

 

Thanks in advance for your help.