473,320 Members | 1,974 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,320 software developers and data experts.

XML reader/write

Hello.

I have built a windows service that has a filewatcher object, which
checks when any XML files have been created or deleted from a certain
directory.
My problem now is i have to get involved with the XML ! which am new
at!

So when i receive the file, currently am just logging in this, i need
to read and parse it and then construct a very similar XML and place it
back in this directory.

What would be the best way to approach this?

Any help really would be appreciated

thanks

Paul

Jan 19 '07 #1
2 1658
ba.hons wrote:
So when i receive the file, currently am just logging in this, i need
to read and parse it and then construct a very similar XML and place it
back in this directory.

What would be the best way to approach this?
That depends on your skill set and on the resources you have. XSLT is a
transformation language that is nice for transforming XML to XML. .NET
1.x supports XSLT 1.0 with System.Xml.Xsl.XslTransform, .NET 2.0 also
supports XSLT 1.0 but with System.Xml.Xsl.XslCompiledTransform.

There are other ways, you can read your XML into a
System.Xml.XmlDocument and the manipulate the DOM (document object
model) to add/change/delete nodes and save the DOM back to a file.

It is also possible to read in XML with an XmlReader and write it out
with an XmlWriter. That is usually more work than using XSLT or DOM but
performs better with large XML documents as both DOM and XSLT build a
tree model of the complete XML document in memory.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 19 '07 #2
If you want to construct a similar XML, you can use the DOM to load and save
it to a different file or rather copy the same file to a new location.
Since you are watching all the XMLs created, you will have to know the
structure of all the XMLs to derive meaning out of it.

If you are looking for a specific tag in an XML then you could use the
search functionality in DOM.

Cheers
Ramananda
"ba.hons" <ba*****@gmail.comwrote in message
news:11**********************@l53g2000cwa.googlegr oups.com...
Hello.

I have built a windows service that has a filewatcher object, which
checks when any XML files have been created or deleted from a certain
directory.
My problem now is i have to get involved with the XML ! which am new
at!

So when i receive the file, currently am just logging in this, i need
to read and parse it and then construct a very similar XML and place it
back in this directory.

What would be the best way to approach this?

Any help really would be appreciated

thanks

Paul

Jan 22 '07 #3

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

Similar topics

2
by: Jens S0nderby Munk | last post by:
Hi, I'm having some problems with the Reponse.BinaryWrite, IE 6.0 and Adobe Reader 6.0. When I try to write a pdf-file to an IE browser with a Adobe Reader 6.0 installed then it just displays a...
2
by: Aaron | last post by:
The example you give me worked until I tried to open an xml file with nested tags. for example the xml looks like this <book> <genre> <action>ABC</action> <bio>DFK</bio> </genre> </book>
1
by: Anand | last post by:
I just implemented a program to solve reader writter prob. Wenever I run the program it seems to go into S+ state and it waits there I dont know why. When i attach gdb to one of the childs and step...
3
by: steve | last post by:
Hi All I need to write a program to read input from barcode scanner. The program is for a gym and needs to detect when a card is scanned regardless of which program is currently running ont he...
5
by: neilphan | last post by:
Hi all, I have an application that uses input from a barcode reader via a USB port. My application works fine only if the application HAS FOCUS. If the user opens up another application (not...
4
by: nishac | last post by:
Hi friends Anybody has worked with the Rss reader flash file to display the blog posts? My code was working well until I upgraded the flash as notified by Adobe.Now my rss not showing any...
3
by: Mark Rae | last post by:
Hi, I've been asked to write a WinForms app which will create reports as PDF documents. The client has agreed that all desktops (WinXP Pro, 32-bit Vista Business) *will* have Adobe Acrobat...
6
by: dgleeson3 | last post by:
Hello All I have VB code (.Net 2005) reading from an SQL server 2005 database. Im getting InvalidCastException when doing reader.GetInt32(0) Im simply reading an int from a simple database. It...
3
by: Matt Nunnally | last post by:
I'm using XmlReader to read an XMl String such as this one: <XML_REQUEST> <USER_ID>Admin</USER_ID> <USER_PW>Test123%</USER_PW> <COMMAND>1</COMMAND> <PRESENT_FLAG>1</PRESENT_FLAG>...
9
by: Mike P | last post by:
Hi All, I want to read in a CSV file, but then write out a new CSV file from a given line.. I'm using the CSV reader and have the the line where i want to start writing the new file from...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...

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.