How do I populate an XSD instance programmatically?

Discussion in 'XML' started by bsdbsd, Oct 5, 2004.

  1. bsdbsd

    bsdbsd Guest

    I need to create valid XML data. This data will need to be able to be
    validated against an XSD schema. The tool I am trying to use is Xerces
    C++. Being new to both C++ and XML, I am a little stumped at how to begin.

    http://xml.apache.org/xerces-c/

    I was given XSD schemas that my raw data needs to be converted to. My
    initial approach has been to create an "empty" instance of the DOM
    structure defined by the XSD file, and then "plug-in" my data in to the
    proper nodes. This is apparently not the right way to do this, as I can
    not find any examples of this on the net.

    If I understand what I've been reading correctly, I need to create a
    root node, then manually add all the nodes required to place my raw data
    in the proper locations of the hierarchy. It would seem there should be
    an easier way to do this, since the DOM structure is already defined in
    the XSD file.

    Also, is it true that the DOM object cannot be verified in RAM, but must
    be saved then reloaded as part of a "conformance" test? Again, it would
    seem there should be an easier way to do this.

    Most of the examples I have found on the net use XML schema instance
    examples that have been contrived by hand. Or they load an existing
    instance, tweak it in memory, and then save it. There are many examples
    that show how to programmatically create simple XML data that does not
    need to conform to an XSD. Are there examples of how to populate an
    empty XSD instance?

    I feel like I am missing something basic here.

    Thanks!
     
    bsdbsd, Oct 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    4
    Views:
    993
    Alexey Smirnov
    Jun 23, 2007
  2. Chris
    Replies:
    9
    Views:
    1,621
  3. Julia B
    Replies:
    1
    Views:
    885
    Julia B
    Mar 19, 2008
  4. John Straumann

    Programmatically populate a GridView

    John Straumann, May 23, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    5,831
    John Straumann
    May 23, 2008
  5. Enjoy Life
    Replies:
    2
    Views:
    283
    Roland Hall
    Feb 23, 2005
Loading...

Share This Page