473,581 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem inheriting from XmlDocument and XmlElement

hello there everyone..
I have created a class called "ProcessLog " inheriting from XmlDocument
and two classes
("UploadedItem" , "ProcessErr or") inheriting from XmlElement.

I then have two classes ("UploadedTempl ate", "UploadedPresen tation") which
inherit from "UploadedItem") ... so far so good.
I have overriden the CreateElement method of "ProccessLo g" and it creates
the correct elements as expected. The problem is I need to override
SelectSingleNod e and SelectNodes to return types "UploadedPresen tation",
"UploadedTempla te" and "ProcessErr or".

I have tried several different ways but always return XmlElement or get a
casting error. I have searched msdn and google but to no avail...
Does anyone have any ideas or an example?... cheers John D
Nov 11 '05 #1
1 2439
As a quick wwork around you could consider overriding these methods,
invoking the base implementation then copying the results into
"UploadedPresen tation", "UploadedTempla te" and "ProcessErr or" types.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"john diss" <do*********@to .spam.me.ta> wrote in message
news:uN******** ******@TK2MSFTN GP12.phx.gbl...
hello there everyone..
I have created a class called "ProcessLog " inheriting from XmlDocument
and two classes
("UploadedItem" , "ProcessErr or") inheriting from XmlElement.

I then have two classes ("UploadedTempl ate", "UploadedPresen tation") which inherit from "UploadedItem") ... so far so good.
I have overriden the CreateElement method of "ProccessLo g" and it creates
the correct elements as expected. The problem is I need to override
SelectSingleNod e and SelectNodes to return types "UploadedPresen tation",
"UploadedTempla te" and "ProcessErr or".

I have tried several different ways but always return XmlElement or get a
casting error. I have searched msdn and google but to no avail...
Does anyone have any ideas or an example?... cheers John D

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3528
by: nibble | last post by:
I'm doign the following: XmlElement myElem....; string name = "xmlns:"+"abc"; string value = "http://www.abc.com"; myElem.SetAttribute(name, value); I get an exception saying that name cannot have ':' in it. However, MSDN usage doc for this method explicitly says that ':' will be parsed and the prefix would be retrieved.
2
3305
by: Compic | last post by:
Hi! I have this class: public class StoredItemElement : XmlElement { protected internal StoredItemElement(string prefix, string localName, string namespaceUri, XmlDocument doc) : base(prefix, localName, namespaceUri, doc) { }
1
3630
by: Casper JH Erasmus | last post by:
How do I save the contents of a TreeView to a XML Document?
4
4173
by: David Grogan | last post by:
Hi, 2 questions.... 1. I'm parsing an XHTML document that contains both the default namespace (xmlns="http://www.w3.org/1999/xhtml") and a custom one (xmlns:r="...") - both of these being attributes of <html>. When I then insert new XmlNodes into the DOM the HTML tags all end up getting an unnecesarry 'xmlns' attribute added, elements with...
1
1608
by: David | last post by:
I need to find a good online resource which teaches the use of the XmlDocument framework in more depth than is covered in MS's online doc. I need to create a multi-level XML document like the one listed below. Using XmlDocument, I can create the <books> and the individual <name> and <price> elements, but I am unsure how to create the...
1
2885
by: John Wilhelm | last post by:
I'm having a problem in by VB.net 2005 application. When i try to get a node from my app.config file the node come back with "nothing". The xmldocment loads OK, but I can't retrive a node. The app.config file is listed below and the code is listed below that, the line with "-->>" is where i try to get the node. Can anyone see where I'm going...
1
1340
by: Viral | last post by:
Hello All, I have the following XML document : (for ease of understanding i am just posting a part of it) Base XML ------------ <?xml version="1.0"?> <ROOT> <REPLY>DRAWLIST_INFO_REQUEST</REPLY>
13
2605
by: sherifffruitfly | last post by:
Hi all, I'm trying to distill all of the info from google searches into what I need, with partial success. In truth, the whole xmlNode, Document, Element, etc group of classes & methods is going over my head - lol! The structure of the xml file I'm trying to append to is as follows: <?xml version="1.0" encoding="UTF-8"?> <!-- stuff -->
4
4363
by: Varangian | last post by:
Hello something I want to ask...... why on earth you cannot inherit from XmlElement???? .... or you can but XmlElement constructor is protected or private and so you cannot define an empty constructor. Even when I tried building a constructor with the exact parameters like XmlElement it wouldn't work!!!! "Error 1 No overload for method...
0
7882
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7808
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5683
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.