473,508 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to reterive xml nodes in C#

1 New Member
hi i am new to to xml, i want to know to how to reterive data of "properties" separately. i can able to reterive the "controllid" from the method GetElementsByTagName(controll), i want to reterive the "width" as well as "height" separately. how ll i do that? please help.
the xml code is below;:

<FORM1>
<controll>
<controllid>Label</controllid>
<properties>
<width>12</width>
<height>5</height>
</properties>

</controll>
<controll>
<controllid>Textbox</controllid>
<properties>
<width>10</width>
<height>5</height>
</properties>
</controll>
</FORM1>
Apr 2 '07 #1
1 1115
sjesurajan
4 New Member
hi,

Try the following code to retrieve the nodes.
xml = new XmlTextReader(Application.StartupPath + "fname.ext");
while (xml.Read()) {
switch (xml.Name) {
case "properties":
break;
case "width":
break;
}
}
I hope this will help you to retrieve the node information.


hi i am new to to xml, i want to know to how to reterive data of "properties" separately. i can able to reterive the "controllid" from the method GetElementsByTagName(controll), i want to reterive the "width" as well as "height" separately. how ll i do that? please help.
the xml code is below;:

<FORM1>
<controll>
<controllid>Label</controllid>
<properties>
<width>12</width>
<height>5</height>
</properties>

</controll>
<controll>
<controllid>Textbox</controllid>
<properties>
<width>10</width>
<height>5</height>
</properties>
</controll>
</FORM1>
Apr 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
10662
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
20
40039
by: Guru | last post by:
Hi I have a table which contains number of rows. I want to fetch the last 5 records from the table. I know for the first 'n' records we can use FETCH FIRST n ROWS ONLY command. But i want to...
3
1822
by: LC | last post by:
Hello all, Ive been using the treeview and for testing purpose i have created 2 Parent Nodes and 5 child nodes within each parent node i.e.- CN = Child Node Parent Node - CN - CN - CN
3
12127
by: juvi | last post by:
Hi, I have got a problem with Treeview.Nodes.Clear() under VB2005. When I have some nodes in my treeview and a force to clear() all nodes then it seems to work, because the nodes are not visible....
1
3249
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
1
2575
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
1
2314
by: Daniel Rucareanu | last post by:
Hello, Does anybody knows how can you delete, in just one step, not using a loop, a subset of the child nodes of a given DOM parent node? The subset will be continous, so for example, if the...
0
1311
by: waldi | last post by:
hii buddy,, i am working in ASP.NET and C#......... i want to store a word document in a MS SQL server7. which will be upoladed by the user. and hence
10
34419
by: John Rogers | last post by:
This code only counts the parent nodes or rootnodes in a treeview, how do you count all the nodes in a treeview? // one way int NodeCounter = 0; foreach (TreeNode currentNode in...
0
7224
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,...
0
7323
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,...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
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...
0
5625
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,...
1
5049
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...
0
1550
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 ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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...

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.