problem with executing xpath and iterate task

problem with executing xpath and iterate task

hi

i have encountered a problem extracting key values pair from after using a "post url " function

i used the following script:

contData=map();
contData.put("TransType","C:INSERT");
contData.put("Username","username");
contData.put("CompanyCode",CompanyCode);
contData.put("CompanyName",FirstName + " " + LastName);
contData.put("CompanyAddress",MailingStreet + " " + MailingCity + " " + MailingState + " " + MailingCountry + " " + MailingZip);
contData.put("CompanyEmail",Email);
contTextOutput=contactDetailsMap.get("responseText"); //info contTextOutput;

/*
so far all is fine and the script works as expected

next i have tried to use executeXpath, but any node i have used has returned an error when executing the script.

so what i tried next is to convert the posturl response ( <variable> contactDetailsMap) to list and then iterate the list:
*/

contTextList=contTextOutput.toList() ; //info contTextList;

for each index text in contTextList
{
contMapvar=contTextList.get(text); info contMapvar;

// at this stage all looks fine, and the variable <contMapvar> holds the values as expected
//example : 
/*    
      ResponseCode:102
      ResponseName:CompanyCodeAlreadyExists
      CompanyCode:356
      Username:g********e
      CompanyAddress:205 ***St' ****v ****v (Gosh Dan) *****64284
      TransType:C:INSERT
      CompanyName:Z** A*******
      CompanyEmail:z**@******s.com 
*/

//the next step is where i can't fgure it out. the variable <contFinalMap> remains empty and the <contResponseCode> returns nothing

contFinalMap=contMapvar.toMap(); info contFinalMap;
contResponseCode= ifnull(contFinalMap.get("ResponseCode"),""); info contResponseCode;
}


//i also tried this without sucess:

for each Text in contTextList
{
//contRespCode=Text.get("ResponseCode");
}
so if any ideas please feel free to share

thanks

Enosh