By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,668 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,668 IT Pros & Developers. It's quick & easy.

storing an xml element

P: n/a
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

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"NotYetaNurd" <No*********@Matrix.com> wrote in message
news:ub****************@TK2MSFTNGP12.phx.gbl...
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


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.