Differently another way to set value for element in XML?
-
Hi , Recently i tried to get an xml file that contains many element with no values and set their values.
<Book>
<Auther>
<Name></Name>
<Age></Age>
</Auther>
<Publicity>
<Year></Year>
</Publicity>
</Book>this xml Element elements has no values and i want to set their values and save the xml string to file.I used to ...
mNodeChild = mDoc.CreateElement("Name");``mNodeChild.Value="John";
. Although, this line code is correct syntax. But when this program write to XML file that is message announcement {Cannot set a value on node type 'Element'} do someone knows how to do it? -
Hi , Recently i tried to get an xml file that contains many element with no values and set their values.
<Book>
<Auther>
<Name></Name>
<Age></Age>
</Auther>
<Publicity>
<Year></Year>
</Publicity>
</Book>this xml Element elements has no values and i want to set their values and save the xml string to file.I used to ...
mNodeChild = mDoc.CreateElement("Name");``mNodeChild.Value="John";
. Although, this line code is correct syntax. But when this program write to XML file that is message announcement {Cannot set a value on node type 'Element'} do someone knows how to do it? -
An xml element doesn't have a value. Use the InnerText property to set the content of the element.
Despite everything, the person most likely to be fooling you next is yourself.