Friday, 13 September 2013

How can i pick the comma separated attribute value in xml one by one as loop in c#

How can i pick the comma separated attribute value in xml one by one as
loop in c#

I would like to use comma separated attribute values defined under
TestCondition in xml one by one in loop for further execution of my
code.Please find the sample xml as follows:
<DrWatson>
<Bugs Name="TEST" TestCondition="STATE,STATUS">
<Bug>
<family>ESG</family>
<product>Dr.Watson</product>
<version>Xpress API</version>
<productarea>1</productarea>
<subarea>Blank</subarea>
</Bug>
<DrWatson>
I am calling the individual attribute value in my code as follows:
attrVal_New = Update_Bugs[m].Attributes["TestCondition"].Value;
string attributelowercase = attrVal_New.ToLower();
m++;
what i want is to use 'STATE' and 'STATUS' available under TestCondition
one by one.Please suggest.

No comments:

Post a Comment