XML data storage database? free and opensource - c#

I need a way to store data inside xml files and write to differant parts of the file, as well as add elements and structure to the xml document.
I need full control over the file names and xml documents, and it would be much easier if I could use some kind of SQL layer to read and write from the xml.
Just due to project constraints I am tied into using XML, but if possible would like a trust and tested open source solution for this.
Or should I be using out of box .net functionality for this?

you should be using out of box .net functionality.
the XML namespaces and Linq-to-XML will do this for you.

Related

XML schema generation library

I'm looking for some library that can parse XML or XSD files and create (even simple) GUI interface which is parsed schema compliant (some kind of a GUI editor for the schema). The user could fill it and save into XML file. I want to use it in my program as a module, so I can't use any external programs. I tried to find something in the Web, but still unlucky:(
Do you know any libraries such like that one? I want it in C# but if there are no such things written in .NET I could have a look at something from other language.
With a simple google search I came up with the following free tools:
XML Data Editor
Easy XML Editor

Send Output direct to HTML or through XML first?

I am writing a parser to parse incoming text files. I have it to where it will parse everything accurately.
I have an option for it to output to text - this was done to check the accuracy of the parsing. I am currently implementing an option to write to a spreadsheet but it doesn't output everything yet.
I have a request to output as static HTML. Is it worth outputting to XML and then generating HTML from that?
I see C# has the XMLTransform class which looks like it would do what I need. Is using the XML designer in VS and writing the XSLT file easier than hand-coding all of the HTML output? I know Excel will import XML files, but it is a little messy and I don't get the formatting options I can get if I generate the .xls file directly
I would give you a qualified No.
It is generally not worth building XML then running it through an XSLT transformation to build HTML.
That said, I might consider such an option if I wanted to easily swap out transformations, such as if this is an app used by multiple clients and the generated HTML would be client dependent. Even then I'd investigate using a simple tokenized HTML template in which I just plugged in the data I wanted. However, if the transformation was sufficiently complex then, yes, I'd go the XSLT route.
The reason for the No is that by the conversion adds such a level of complexity that it is usually not worth the time involved.

Manipulating a file that is like XML

I have a file that I want to read and manipulate. It is XML like but is not an actual XML file. It does reference a DTD however. What part of the .Net framework can I use to do the above? Will the XML API's work some how with this file?
Based on your reply to my comments, it sounds like if all that is different from a standard XML document is the lack of a header, the tools should work perfectly fine with that data. I would give System.Xml a try, and if that doesn't work, try prepending the header.

Generating text file from database

I have a requirement to hand-code an text file from data residing in a SQL table. Just wondering if there are any best practices here. Should I write it as an XMLDocument first and transform using XSL or just use Streamwriter and skip transformation altogether? The generated text file will be in EDIFACT format, so layout is very specific.
The normal thing to do is just write the EDIFACT data directly.
Creating it as an XMLDocument and transforming it to EDIFACT might be useful if there's a library already available to do the transformation. I say this because there's a lot of language support for XML output.
I can't see how XSL will help you here, but I've never had to output EDIFACT data.
http://www.stylusstudio.com/edi/XML_to_EDIFACT.html
This URL has an example XSLT for translating XML to EDIFACT which might solve your problem.

How can I save objects as XML files

I'm working on my high-school matriculation asp.net project, and I wish to make a website of a bookstore.
I want to create two classes,Book and BookStore, and save the data created in XML files and not in a database.
How can I save objects as XML files, and how can I load them afterwards?
Thank you very much.
You need to use XML serialisation. There are tons of examples of how to do this, but here's one link for you to get started:
http://devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=236

Categories