Hi,
I am working with DOM and I need to do the following:
<sequence>
<element name="input1" type="string"/>
<element name="input2" type="string"/>
<element name="input3" type="string"/>
</sequence>
The problem is, I do not know how many inputs I will have until runtime. So
I have to generate the element Elements on the fly. One way to construct the
node would be like this:
XmlDocument doc = new XmlDocument();
doc.LoadXml("<sequence>" +
"<element name='input1' type='string'/>" +
....and so on... +
"</seqence>");
MyDoc.ReplaceChild( doc, MyDoc.FirstChild ); or something along those lines
My question is, since I do not have a way of knowing how many inputs we have
until runtime, I have to put a for loop and name the inputs as input1,
input2....
How can I ge this 'input1' from my code which is doing this
for (int i = 0; i < numOfOperations; i++)
s = s + "<element name="+ 'input + i '+" type='string'/>");
I am getting 'input+i' instead of input1. Is there any way to force the
character to
convert the value instead of treating it as a literal??
Thanks
Faraz