473,608 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xmlNode auf xmlElement casten

hi,

ich habe eine anwendung, welche ein xml document erstellt.

um festzustellen, ob ein element bereits vorhanden ist,
verwende ich die funktion

selectsinglenod e( ....)

diese funktion liefert mir ein element des typs node.

das xmlNode kann aber nicht wirklich viel. z.b Attribute
anhängen...

kann ich das xmlNode auf xmlElement caste?

xmlNode myNode;
xmlElement myElement;

myNode=myDoc.Se lectSingleNode( ...);
myElement=(xmlE lement)myNode;

ist das möglich, oder gibt es eine möglichkeit attribute
an ein xmlNode anzuhängen?

danke
Nov 15 '05 #1
1 4739
ich spreche keine duetsche. (I speak no German). And I know very
little XML, so here's Google's translation for anybody who can assist
andrej... (Of course, he'd probably prefer a German response)...

I have an application, which provides xml a document. in order to
determine, whether an element is already present, I use the function
selectsinglenod e(....) this function supplies an element of the type
node to me with. the xmlNode cannot attach however really much e.g.
attributes... can I do the xmlNode on xmlElement caste?

xmlNode myNode;
xmlElement myElement;
myNode=myDoc.Se lectSingleNode( ...);
myElement=(xmlE lement)myNode;

is that possible, or does give it a possibility of attributes to a
xmlNode to attach? thanks

"andrej" <an****@gmx.a t> wrote in message
news:00******** *************** *****@phx.gbl.. .
hi,

ich habe eine anwendung, welche ein xml document erstellt.

um festzustellen, ob ein element bereits vorhanden ist,
verwende ich die funktion

selectsinglenod e( ....)

diese funktion liefert mir ein element des typs node.

das xmlNode kann aber nicht wirklich viel. z.b Attribute
anhängen...

kann ich das xmlNode auf xmlElement caste?

xmlNode myNode;
xmlElement myElement;

myNode=myDoc.Se lectSingleNode( ...);
myElement=(xmlE lement)myNode;

ist das möglich, oder gibt es eine möglichkeit attribute
an ein xmlNode anzuhängen?

danke
Nov 15 '05 #2

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

Similar topics

2
6209
by: Earl Teigrob | last post by:
I am having trouble creating an Attribute on a new node. The NodeObject.SetAttribute(x,y) method does not exist for the "RecordElement" node. What am I missing??? Earl XmlDocument d = new XmlDocument();
2
65591
by: Pluto | last post by:
What is the difference between XmlNode and XmlElement? I'm trying to implement the code at http://www.devx.com/dotnet/Article/11616/0/page/3 in C# and I'm getting an error at this line: this.appSettingsElement = this.xml.SelectSingleNode("//configuration/appSettings"); Error: Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.XmlElement'
2
10380
by: David Elliott | last post by:
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation.
3
8110
by: Mahesh Devjibhai Dhola | last post by:
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...
1
1384
by: Dominic Messenger | last post by:
I have a schema that I load into classes that mirror the schema using the XmlSerialization. The schema contains an xsd:Any that I load into 'Extra' as follows: public XmlNode Extra { get { return extra;} set { extra = value;}} However, if I have: <Something>
5
5096
by: Paul | last post by:
Here I have the definition of an XmlNode which is a property (PayPreference) on my Customer class containing an enum describing how the customer will pay. <PayPerference xsi:type="a4:Customer+CustomerPayOptions" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/OsfDomain.Resources.Stage/OsfDomain%2C%20Version%3D1.0.0.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">cash</PayPerference> I now want to add this XmlNode to a different...
5
2135
by: Mahesh Devjibhai Dhola | last post by:
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...
5
3875
by: GaryDean | last post by:
I have a web service method that returns an XMLDocument. The signature is: public XmlDocument GetPOs() The following client code calls this method but it accepts an XMLNode instead of an XMLDocument and my first question is why does this work? XmlNode neNode; neNode = myHFCService.GetPOs(); DataSet myds = new DataSet();
4
13597
by: CSharper | last post by:
I am reading an XmlFile using XmlDocument and traverse through the XmlNode, as I read I need to append an attribute to the XmlNode on some conditions. I tried xmlNode.Attributes.Append() It takes only XmlAttribute and in this when I create a new XmlAttribute, it doesn't allow me to set the name and value as the name is only the readonly value. How can I achive this?
0
8057
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7998
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
6813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6010
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3959
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4022
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1580
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1327
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.