I need to create an xml file from a VB program using fields returned from an sql query. I have a template that was provided for me and need to use verbatim. Since this is just a text file, I gather that I can just write out the file with all of the tags, etc., and name it .xml. Assuming that is correct what I might want to do is create a template so that if this file changes the names of the elements, all I have to do is change the template and if more elements get added I can then add them. Is there a tool that can do this for me? If I have to create one, any suggestions as to what I can put in the space where my variables go which won't interfere with any key words. Thank you for any help.
"Ellie" wrote in message news:OnZQJUo9JHA.5064@TK2MSFTNGP03.phx.gbl... > I need to create an xml file from a VB program using fields returned from > an sql query. I have a template that was provided for me and need to use > verbatim. Since this is just a text file, I gather that I can just write > out the file with all of the tags, etc., and name it .xml. Assuming that > is correct what I might want to do is create a template so that if this > file changes the names of the elements, all I have to do is change the > template and if more elements get added I can then add them. Is there a > tool that can do this for me? If I have to create one, any suggestions as > to what I can put in the space where my variables go which won't interfere > with any key words. Thank you for any help. > You could just treat as a txt file but that is normally poor practice as you'd be in charge of escaping special characters and other XML gotchas. However there are a number of ways of doing this with VB. What version of VB are you using and can you show a small example of a template and how you know which data goes where? -- Joe Fawcett (MVP - XML) http://joe.fawcett.name