Thread: How to convert/write data to XML file?

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    2

    How to convert/write data to XML file?

    Hello folks. I'm doing a homework that requires me to write/convert data from CSV to a XML file. Using C only. What kind of library supports this? Do I have to create the XML form all myself? I currently done the part of reading data from CSV into an Array, but still know not how to write it to XML. Any advice/help is highly appreciated! Thanks in advance.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Basicly the task is one of creating and writing strings... If you know the XML keywords and the data values, it's just a matter of writing a text file.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    2
    So does that mean C doesn't support create XML file type itself? I thought there would be a better way.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    XML files are just plain old text files...

    Compose a string, write it to a file.

    There's no magic.

  5. #5
    Registered User
    Join Date
    Sep 2011
    Location
    Stockholm, Sweden
    Posts
    131
    There is no built-in support for XML-files in C, but if you are allowed to use external libraries there are a few to choose from. If it is a homework assignment I'm guessing the instructor wants you to do it by yourselves though. And if it is a very simple XML-file that you have to create, it is probably easier to create it using regular C-functions rather than using an external library.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to write data from file to structure, This case is different.
    By TanzeelurRehman in forum C Programming
    Replies: 6
    Last Post: 12-22-2010, 11:34 PM
  2. Convert data from file into a matrix
    By GARiMTO in forum C Programming
    Replies: 2
    Last Post: 11-22-2007, 02:17 PM
  3. write data to end of file
    By sujeet1 in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2007, 12:45 PM
  4. Write data to a disk file
    By bnd98 in forum C++ Programming
    Replies: 11
    Last Post: 04-20-2003, 04:21 PM
  5. Need to write data to file, not sure how
    By Unregistered in forum C Programming
    Replies: 7
    Last Post: 03-20-2002, 12:17 AM