Generating Sample XML

This should cover W3C XML Schema, Relax NG and DTD related problems.
sohailsikora
Posts: 2
Joined: Fri Jan 06, 2006 7:33 pm

Generating Sample XML

Post 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?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
sohailsikora
Posts: 2
Joined: Fri Jan 06, 2006 7:33 pm

Creating XML

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Creating XML

Post 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
cbwhitebu
Posts: 2
Joined: Mon Jan 30, 2006 8:56 pm

Post 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).
Post Reply