storing an xml element

  • Thread starter Thread starter NotYetaNurd
  • Start date Start date
N

NotYetaNurd

I have a situation , where in I had to store a bit of information about a
treenode in Tag .....

like this
"<shorcut key="M1" startpos="33" >System.Windows.MessageBox.Show("");
</shorcut>"

ideally i should be creating an xmlelement add attributes and store the
xmlelement in Tag...

but am not able to do this
i tried
XmlElement xle = new XmlElement();
but got this exception
'System.Xml.XmlElement.XmlElement()' is inaccessible due to its protection
level ...

How do i declare an xmlelement and add attributes to it and then add to Tag
Property ..

Regards
 
NotYetaNurd,

You have to call the CreateElement method on the XmlDocument class that
you want to add it to. Remember, you have to add the element to the node
using the Append method once you have created your element.

Hope this helps.
 
Back
Top