473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Reading XML Node-by-Node

Hey there...

I intend to make a WindowsApp menu like...
For that I need to read a XML file node by node to try to create (at
runtime) the items...

Where can I find some clear information on how to do this???

MSDN never helped me... lol...

tks in advance...
Christiano
Nov 12 '08 #1
4 3318
You could use XmlSerializer to read xml file into object and the you can
operate with object and do what you want...

PS: MSDN will help you to find out how to use XmlSerializer

George.
"Christiano Donke" <cd****@digiexpress.com.brwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hey there...

I intend to make a WindowsApp menu like...
For that I need to read a XML file node by node to try to create (at
runtime) the items...

Where can I find some clear information on how to do this???

MSDN never helped me... lol...

tks in advance...
Christiano
Nov 12 '08 #2
the XmlReader is designed for a forward pass of reading an xml file/string.
building a menu is just css and <ol><lihtml elements.

-- bruce (sqlwork.com)
"Christiano Donke" wrote:
Hey there...

I intend to make a WindowsApp menu like...
For that I need to read a XML file node by node to try to create (at
runtime) the items...

Where can I find some clear information on how to do this???

MSDN never helped me... lol...

tks in advance...
Christiano
Nov 12 '08 #3
Christiano Donke wrote:
For that I need to read a XML file node by node to try to create (at
runtime) the items...
Well the .NET framework has several XML APIs. There is XmlReader for
fast but forwards only pull parsing, there is
XPathDocument/XPathNavigator for XPath 1.0 based access, and in .NET 3.5
you also have LINQ to XML. There is also XmlDocument but that is mainly
needed when you want to manipulate an XML document, otherwise
XPathDocument/XPathNavigator should suffice and perform better.

XmlReader might suffice for your purpose. To decide which of the other
options to use you need to provide more details as to which .NET version
you use and whether or not you know XPath for instance so that it makes
sense for you to use an API that supports XPath.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '08 #4
I'm using VS2005, .NET 2.0

Have read a little about XPath, but not enough to write something...

i was planning to read the XML file and, first of all, ignore the Root Node
tag, this way, it won't show on TreeView and other components like this...
then, i would read the node name to check if it's an item or and subitem,
and place the #InnerText in the correct place in the treeview...
"Martin Honnen" <ma*******@yahoo.deescreveu na mensagem
news:eB**************@TK2MSFTNGP05.phx.gbl...
Christiano Donke wrote:
> For that I need to read a XML file node by node to try to create (at
runtime) the items...

Well the .NET framework has several XML APIs. There is XmlReader for fast
but forwards only pull parsing, there is XPathDocument/XPathNavigator for
XPath 1.0 based access, and in .NET 3.5 you also have LINQ to XML. There
is also XmlDocument but that is mainly needed when you want to manipulate
an XML document, otherwise XPathDocument/XPathNavigator should suffice and
perform better.

XmlReader might suffice for your purpose. To decide which of the other
options to use you need to provide more details as to which .NET version
you use and whether or not you know XPath for instance so that it makes
sense for you to use an API that supports XPath.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '08 #5

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

Similar topics

0
by: Andy | last post by:
Hi, In the code below (not pretty I know but it's an early version :-P) I'm having problems reading the data object back in. If I move the reading code to immediately after the section where it...
6
by: Raymond Hettinger | last post by:
Found in a pamphlet at a pre-school: --------------------------------------- Reading improves vocabulary Reading raises cultural literacy through shared knowledge Reading develops writing skills...
24
by: Hendrik Schober | last post by:
Hi, I have a 'std::istream' and need to read its whole contents into a string. How can I do this? TIA; Schobi
4
by: Oliver Knoll | last post by:
According to my ANSI book, tmpfile() creates a file with wb+ mode (that is just writing, right?). How would one reopen it for reading? I got the following (which works): FILE *tmpFile =...
3
by: Nick | last post by:
I have found a class that compresses and uncompresses data but need some help with how to use part of it below is the deflate method which compresses the string that I pass in, this works OK. At...
21
by: JoKur | last post by:
Hello, First let me tell you that I'm very new to C# and learning as I go. I'm trying to write a client application to communicate with a server (that I didn't write). Each message from the...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
4
by: Gaijinco | last post by:
I had a file named nap.in which looks like this: 4 10:00 12:00 Lectures 12:00 13:00 Lunch, like always. 13:00 15:00 Boring lectures... 15:30 17:45 Reading 4 10:00 12:00 Lectures 12:00 13:00...
21
by: Naya | last post by:
Hello, everyone!!! Well, I have a situation here. I am trying to read this data from a file, but the wrong values keep spitting out at me. Here's what I mean: Program: int main() {...
16
by: WATYF | last post by:
Hi there... I have a huge text file that needs to be processed. At the moment, I'm loading it into memory in small chunks (x amount of lines) and processing it that way. I'd like the process to be...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.