Convert .xsd to .xml

Are you missing a feature? Request its implementation here.
don_bush

Convert .xsd to .xml

Post by don_bush »

I would like to generate a sample .xml file from an .xsd file similar to the feature that is available in other xml editors such as XMLSpy. Is this feature planned?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

We do some content generation only that we do not take any guess on choices. We generate only the required content if it is possible to generate it without ambiguity. For instance if you create a new XML document and specify the personal.xsd schema from the samples directory and select personnel as the root element the generated document will look like below:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"file:/D:/users/George/projects/eXml/samples/personal.xsd">
<person id="">
<name>
<family></family>
<given></given>
</name>
</person>
</personnel>
We will think about generating content also in case of optional and choice models. One strategy we can follow for choice is to always go on the first option. An alternative to this is to ask the user to select the one of the possible alternatives for each choice.

Let us know how do you think this should work to help you.

Best Regards,
George
Don Bush
Posts: 2
Joined: Wed Sep 03, 2003 4:27 pm

Post by Don Bush »

Actually I wasn't aware that your program generated a sampl;e document at all. That's great, however, I see what you mean - it is pretty limited without automatically generating the choice and optional elements. I would suggest always generating the choice, ideally by asking the user which choice should be used on a global basis. I suggest that the cabability to generate optional elements be added as well. You could ask the user if they would like the optional to be generated before creating the document. Additionally, I think it would be good to allow the user to indicate how many occurrences of repeating elements should be generated. Thanks.
Don Bush
Posts: 2
Joined: Wed Sep 03, 2003 4:27 pm

Post by Don Bush »

Actually I wasn't aware that your program generated a sample document at all. That's great, however, I see what you mean - it is pretty limited without automatically generating the choice and optional elements. I would suggest always generating the choice, ideally by asking the user which choice should be used on a global basis. I suggest that the cabability to generate optional elements be added as well. You could ask the user if they would like the optional to be generated before creating the document. Additionally, I think it would be good to allow the user to indicate how many occurrences of repeating elements should be generated. Thanks.
Post Reply