String Length of an Xml File

String Length of an Xml File

  
Hello,
I have a doubt i need to show multiple rows in a table for an xml file.
Please see my attachment where i would have mentioned about my doubt.
Im using for loop to get multiple rows in doing that when incrementing i.e when i=1 its showing 
index1 is out of range.And in the attachemnt where i highlighted an insert operation.
In that im assigning String_Split.List[i].Text.Value to Temp varaible this is where when i is incrementing to 1 its showing exception error.Anything i can do that for this.

Regards,
ChandrasekarRadhakrishnan

Hi,
I have atatched my oml file for reference.
Ok,

I have no clue what you even try to achieve.
the logic is very strange.

- comments! comments! what are you trying to do?
- what xml are you splitting and why with a double quote?
- why checking on length of the records itself?
- i is the counter, yet you check with the length of the current record in the list, why is that?
or do you mean you want to check the length of the list it self?
then you should check/validate it with String_Split.List.Length
- why not do it totally with xpath? 

too many questions now, so I stop

HI Chandra,
Can you please post the XML (string ) , i thought th eproblem is " you are trying to get the value from an index which does not exists o(as you are incrmenting i).
Plesae check first how many splitted rows are being returned by the split function and value of i.

Hi,
This is the xml which we are passing.In that i want the credit liability to be stored multiple times in one of the
tables say for eg liability.

Regards,
CR

Hi J,
When trying to do with xpath i'm not able to get that particular values .I want to get all fields from credit liability to be stored multiple times in a table.

Regards,
ChandrasekarRadhakrishnan
Hi J,
Instead of String_Split.List.Length i used Length(Text) to calcuate the length of the string which im
getting but the thing is that after the first incrementation its showing the exception i mean index is out of range.

Regards,
CR

Hi,
If you see my attachment this is the part i need to show multiple times in my table.I mean the credit liability.

Regards,
CR

HI J,
Infact i'm tried using xpath  to get the particular node i.e CREDIT_LIABILITY BUT i'm not able to retrieve its retrieving some other value .Just see my oml file which i have attached before you  would see xpath which i have used.

Regards,
CR 
Hi,

If you see my latest attachment i have highlighted the fields inside the credit liability which is repeated n number of times in the xml file and all those
data i need to store inside the table.

Regards,
CR 
HI,

XmlDocument doc = new XmlDocument();
            doc.Load(@"C:\haresh\Plzsend.txt");
 
            XmlNodeList nodes = doc.SelectNodes(@"/RESPONSE_GROUP/RESPONSE/RESPONSE_DATA/CREDIT_RESPONSE/CREDIT_LIABILITY");
 
            foreach (var item in nodes)
            {
                
            }
            Console.Read();

This is the code which i ahve written in c# which will count the number of nodes from the credit liability.
 
Just use the Xml Records extension, define the structure of you Xml in a structure and get your XML as a record list.