- Home /
This question was
closed May 29, 2013 at 09:23 AM by
sona.viswam for the following reason:
The question is answered, right answer was accepted
Question by
sona.viswam · May 15, 2013 at 05:15 AM ·
transformxmlid
how to give id to tag in xml
how to give id to a tag in xml using script
XmlElement elmNew1 = xmlDoc.CreateElement("con1");
XmlElement X1 = xmlDoc.CreateElement("aaa");
X1.InnerText = ("hhh");
elmNew1.AppendChild(X1);
for con 1 i have to give id = 1.
How can i give??
Comment
Best Answer
Answer by whydoidoit · May 15, 2013 at 07:47 AM
You need to create an attribut and set that on the element. See this: http://msdn.microsoft.com/en-us/library/08dy2b79.aspx
Basically
var id = xmlDoc.CreateAttribute("id");
id.Value = 1;
X1.SetAttributeNode(id);
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
path of xml file 1 Answer
Temperature Script? 3 Answers
guiText/GameObject position 2 Answers
JS. error BCE0043 unexpected token 2 Answers