views:

29

answers:

2

I am starting a project in which I need to get two sets of data into flat files. Source A is a web service that is updated daily, so I only need to hit this once a day. Source B is an XML file on an FTP site that I will also retrieve daily.

I have never converted XML to a flat file before. I'm a SQL Server guy, so my initial thought was to work on getting the data into SQL Server, then export to flat files. However, am I wasting my time doing that? Should I just use a conversion tool such as XMLConvert and skip SQL Server entirely? The data files are fairly small, so performance is not an issue. I need to get this done as quickly as possible. What suggestions do you folks have? Thank you!

+1  A: 

Converting XML to other (text-based) formats is probably best done using something like XSLT. http://www.w3schools.com/xsl/

I am familiar with XSLT, I am more looking for suggestions on software tools that would make this conversion simplest. Thank you.
SomeGuy
XSLT is probably the only reasonable approach. Ultimately, a tool would have to be aware of the xml schemas, and configured to output the elements / attributes of interest in csv format. By the time you configured such a tool, you may as well have written the XSLT templates. It might be more productive to put the sample XML up and ask for help writing the XSLT templates to do the transform.
Brett
A: 

I have used Stylus Studio to create XSLT and was very happy with the features. http://www.stylusstudio.com/

I have also used XML Spy, but not the XSLT features. http://www.altova.com/xmlspy.html

Once you have the XSLT created the code to transform the XML is fairly straightforward. http://msdn.microsoft.com/en-us/library/ms757854(v=VS.85).aspx

I've used this method to convert XML into HTML, but not a flat file, but it should work.

Darryl Peterson