Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 21st, 2006, 04:55 PM
Nettar
Guest
 
Posts: n/a
Default Generate Sample DOM tree for an XSD

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.

  #2  
Old July 21st, 2006, 07:15 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Generate Sample DOM tree for an XSD

Nettar wrote:
Quote:
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.
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles