Editing XML files

  • I have an xml file that is output from a sql server application each night. I need to edit the content of the file each night (after it is produced) and provide an updated xml file.

    As part of the editing I will need to read data from a sql server table. The xml file is quite big (approx 8MB)

    I am wondering can anyone suggest how I can achieve this?

    Thanks

  • The approach to use depends a lot on more specifics than you've provided here.

    Generally speaking, there are three good ways to modify an XML document programmatically. You can transform it via XSLT, you can read it into a DOM and manipulate it, or you can run it through a SAX parser. (Bad ways include any form of string manipulation. If you ever do anything with a stream of XML data except pass it to a parser or write it to disk, you're almost certainly making a terrible mistake.)

    I would tend to use XSLT myself, but a) I know XSLT like the back of my hand, b) I use .NET 2.0, which performs really well on XSLT transforms. But if you don't know XSLT, you have a very long learning curve ahead of you. (Though not as long as you'd have if you use SAX.)

    Provide more details and I'll be able to give you a better answer.

    Robert Rossney

    rbr@well.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply