Page 1 of 1

Generating Sample XML

Posted: Fri Jan 06, 2006 7:40 pm
by sohailsikora
Creating a new XML file from a schema seems to generate the document node only

This thread:

http://www.oxygenxml.com/forum/ftopic99 ... 75db872d6f

seems to suggest that we can generate the complete document with the text tags not containing any data. Am I missing something?

Posted: Mon Jan 09, 2006 1:58 pm
by sorin_ristache
Hello,

If only the root node is generated you should look at the content model described in your schema. If the content model of the root contains optional child elements you have to enable Add optional content in the Create an XML document dialog. If it contains a choice pattern you have to enable Add first choice particle in the dialog. This works only for XML Schema and DTD. For Relax NG and NRL schemas you have to enter the tags manually with the help of the tag insight assistant.

Regards,
Sorin

Creating XML

Posted: Mon Jan 09, 2006 9:47 pm
by sohailsikora
I did try again after enabling the 2 options. The results remain unchanged. Unfortunately, I cannot publish the schema for you to try. I did try to create a document using an XML Schema written by STAR (automotive standards XML) and it worked fine. I did get the document with the empty tags. Is there some way for me to assign some boilerplate text to the empty tags?

The tool works fine and the error seems to be with the schemas I have. Thanks for all the help.

Re: Creating XML

Posted: Tue Jan 10, 2006 5:00 pm
by george
sohailsikora wrote:[...]Is there some way for me to assign some boilerplate text to the empty tags?[...]
No, that is not possible. I guess we can have an option to enable placing eventually the simple type name as value in case of XML Schema. I will log this as an enhancement request on our bugzilla.

Best Regards,
George

Posted: Mon Jan 30, 2006 8:59 pm
by cbwhitebu
I think generating sample content would be great. However, if you are going to generate sample content then the content will need to be of the correct type (e.g. a date element needs to contain a valid date).