Problem in deriving custome class from XmlNode

  • Thread starter Mahesh Devjibhai Dhola
  • Start date
M

Mahesh Devjibhai Dhola

Hi All,
I want to make a custom class in c#, which extends System.Xml.XmlNode class
of BCL.

Now in custom class, I have implement abstract methods of XmlNode class
also. Now when I am trying to run the class it gives an error that
"System.Xml.XmlNode.XmlNode() is inaccessible due to its protection level".

This error comes because XmlNode has not any public constructor. I found
XmlNode has two constructor but both are private or friend (i dont know
exactly).

I also found one MSDN article where it says that "Never derive any class
directly from XmlNode" but its just recommendation.
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
ml/cpconextendingdom.asp)

Though, Microsoft has derived some of BCL classes from base XmlNode, so why
we can not derive?
System.Object
System.Xml.XmlNode
System.Xml.XmlAttribute
System.Xml.XmlDocument
System.Xml.XmlDocumentFragment
System.Xml.XmlEntity
System.Xml.XmlLinkedNode
System.Xml.XmlNotation

So i think there must be some way out of this....

So what to do to create a derived class from XmlNode?
I heard that many experts are giving their service in news groups. So please
help me out of this.

I have already derived few of my classes from XmlDocument, XmlElement,
XmlAttribute etc. So i dont want to derive from them but i want to derive
the class from XmlNode it self. Please help me to get the answer...

Thanks in Advance.

Thanking you,
Mahesh Devjibhai Dhola
"Empower yourself...."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top