Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to create xml document using Schema in MFC application?

How to create xml document using Schema in MFC application?

Scheduled Pinned Locked Moved C / C++ / MFC
xmlc++databasetutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hemamerp
    wrote on last edited by
    #1

    Hi, Using MFC application, i need to input an xml schema to an MFC exe and i need to generate xml file as an output from the specified schema. I need to do this only in MFC application. Please suggest me some resolution as how to generate xml from schema using MFC application? Regards, Hema K

    C 1 Reply Last reply
    0
    • H hemamerp

      Hi, Using MFC application, i need to input an xml schema to an MFC exe and i need to generate xml file as an output from the specified schema. I need to do this only in MFC application. Please suggest me some resolution as how to generate xml from schema using MFC application? Regards, Hema K

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      It really depends of what you are trying to achieve. I suppose your xsd has a well defined structure otherwise there is no possible way for your MFC application to magically generate the data that is required to fill your xml file. In that case, what you could do is use a tool to generate classes based on your xsd file (which is called "data binding"). Those classes are added to your project sources and you manipulate them in your MFC application. Once the user has entered the data and you filled the different classes with the user data, you simply use the same library to serialize them into an XML file. You can for instance look at CodeSynthesis[^], which is a free tool. If that doesn't answer your question, then please provide more information about what you are trying to achieve.

      Cédric Moonen Software developer
      Charting control [v2.0] OpenGL game tutorial in C++

      H 1 Reply Last reply
      0
      • C Cedric Moonen

        It really depends of what you are trying to achieve. I suppose your xsd has a well defined structure otherwise there is no possible way for your MFC application to magically generate the data that is required to fill your xml file. In that case, what you could do is use a tool to generate classes based on your xsd file (which is called "data binding"). Those classes are added to your project sources and you manipulate them in your MFC application. Once the user has entered the data and you filled the different classes with the user data, you simply use the same library to serialize them into an XML file. You can for instance look at CodeSynthesis[^], which is a free tool. If that doesn't answer your question, then please provide more information about what you are trying to achieve.

        Cédric Moonen Software developer
        Charting control [v2.0] OpenGL game tutorial in C++

        H Offline
        H Offline
        hemamerp
        wrote on last edited by
        #3

        Hi, My schema file is very large and it contains so many particles, elements and attributes. The data binding provides so many classes for an single schema file. I have several schema files like this. Code will be very complex if i start doing data binding for all the schema files. Is there an Generic utility or Generic API in MFC so that it accepts any schema file and it can create an xml file from specified schema. Regards, Hema K

        C 1 Reply Last reply
        0
        • H hemamerp

          Hi, My schema file is very large and it contains so many particles, elements and attributes. The data binding provides so many classes for an single schema file. I have several schema files like this. Code will be very complex if i start doing data binding for all the schema files. Is there an Generic utility or Generic API in MFC so that it accepts any schema file and it can create an xml file from specified schema. Regards, Hema K

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          hemamerp wrote:

          Is there an Generic utility or Generic API in MFC so that it accepts any schema file and it can create an xml file from specified schema.

          This doesn't make sense: you need to have some data to fill your xml file. The xsd only specifies the structure of your final xml file, but you still have to provide the data yourself. So, from where is this data coming from ?

          Cédric Moonen Software developer
          Charting control [v2.0] OpenGL game tutorial in C++

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups