Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Generate Sample DOM tree for an XSD

Reply
Thread Tools

Generate Sample DOM tree for an XSD

 
 
Nettar
Guest
Posts: n/a
 
      07-21-2006
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.

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      07-21-2006
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.
 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert E4X XML tree inside existing DOM tree Joris Gillis XML 2 06-16-2006 08:30 PM
sample on how to generate XML skeleton from XSD akira XML 0 05-15-2006 02:28 PM
XML + XSD: Is it possible to get all errors against the XSD? Markus Java 1 11-22-2005 02:53 PM
any tools generate sample XML from XSD? jrefactors@hotmail.com XML 1 02-04-2005 08:13 AM
B tree, B+ tree and B* tree Stub C Programming 3 11-12-2003 01:51 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57