473,698 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1673
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. XslCompiledTran sform.

There are other ways, you can read your XML into a
System.Xml.XmlD ocument 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.goo glegroups.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
5246
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 blank page and the earth on the top rigth corner keeps turning like it haven't read the pdf-file (for 10+ minutes on a lan). If I change the settings on the Adobe Reader 6.0 to not open in a browser, then it works fine. If I use Mozilla 1.4 then...
2
5413
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
1914
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 through for some lines and dettach it runs for some time again ????? The program is listed below. The listing is kind of long
3
10689
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 computer. e.g the operator might be typing a letter and a member swipes his card. I am convinced I need to write the card reader section as a Windows Service, so it is active always?
5
5426
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 mines) such as notepad/word, etc, the Barcode Reader reads data into the applicaton that currently has focus with is notepad/word but not my own applicaton. My question is as follows: Is there a way to write a Listener
4
1850
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 blogs.Can anybody help me in this regard?Can it be a problem with xml? I am giving my code hereby document.write('<a href="/blog/blog.html"><img src="../images/rssreader_head.jpg" alt="Recent Blog Posts" border="0" style="margin-bottom:0;" /></a>') ...
3
4081
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 Reader installed but, in the interests of robustness, I want to check for this when the app loads. Would you recommend checking for the Adobe Acrobat Reader specifically, or
6
4971
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 has two columns, User and Tel number. User is filled with 1,2,3 and tel number has 3 telephone numbers. The User data column is specified as (PK, int, not null) in MS SQL
3
1101
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> <INVOICE></INVOICE> <TRANS_AMOUNT>6.00</TRANS_AMOUNT> </XML_REQUEST>
9
3975
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 begins with "Transaction ID", i thought it should be something along the lines of below.. obvioulsy
0
8604
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
9157
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7728
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
6518
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
5860
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
4369
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.