Generate Sample DOM tree for an XSD

Discussion in 'XML' started by Nettar, Jul 21, 2006.

  1. Nettar

    Nettar Guest

    Hi,

    Is it possible to generate a sample DOM tree for a given XSD
    programatically using Java?

    I know that some tools can generate a sample XML for the given XSD. I
    want to do this programatically.

    Can anyone suggest any approach for achieving this?

    Thanks,
    Jayarama Nettar.
     
    Nettar, Jul 21, 2006
    #1
    1. Advertising

  2. Nettar wrote:
    > Can anyone suggest any approach for achieving this?


    Read the schema. Start from the top-level element description and
    examine what its possible contents are. Generate something at random
    that meets those constraints. Recurse downward until all branches of the
    DOM tree have reached nodes which do not have further content.

    That will produce a document which matches the schema. It may not be a
    document which makes any sense in application terms, depending on just
    how many of the application constraints have been encoded into the schema.
     
    Joe Kesselman, Jul 21, 2006
    #2
    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. Jake
    Replies:
    0
    Views:
    604
  2. Replies:
    1
    Views:
    628
    anonymous
    Feb 4, 2005
  3. akira
    Replies:
    0
    Views:
    1,340
    akira
    May 15, 2006
  4. Joris Gillis
    Replies:
    2
    Views:
    1,566
    Joris Gillis
    Jun 16, 2006
  5. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,234
Loading...

Share This Page