Xml
8 answers - 256 bytes -

I want to create a sample XML file from an XSD file...
Any recommended freeware that could do this for me?
(Want to create some test data)
Have already tried using Eclipse and had some problems... anything else?
Cheers!
No.1 | | 212 bytes |
| 
An XML schema file is an XML document. If you want to extract data from it use an XSL stylesheet. Modern browsers IE6+/Opera/Firefox all support XSL.
XML forum (http://vbforums.com/forumdisplay.php?f=11)
No.2 | | 394 bytes |
| 
mmm... ok
What I want to do is automatically create an XML file that conforms to the XSD.
Not sure if this analogy is useful, but if the XSD was a class then I would like to instansiate it.
I know this is a little "backwards" since the XSD was designed to validate the XML, but we need some XML data for our testing.
Hope this makes sense!
Cheers!
No.3 | | 236 bytes |
| 
Oh.
Usually one creates the schema around the data :p
If you make a program that creates random XML files that conform to your schema then there's not going to be much point in testing the schema file is there? :)
No.4 | | 568 bytes |
| 
...
Usually one creates the schema around the data :p...
Well sort of. Usually a Schema describes a standard two or more partys have committed on. Of course it is created around the data that should be exchanged, but usually the xsd is first! It describes how your XML File is supposed to be structured.
I know that XMLSpy from Altova can do what you asked for, but I dont know if the Free Home Version supports it.
http://www.altova.com/support_freexmlspyhome.asp
Dont know of any other Freeware stuff doing it. Sorry!
Stephan
No.5 | | 320 bytes |
| 
Penagate & Sgt-Peppa,
Thanks for replies.
I have also tried XML Spy, but it is not creating the XML files properly... unfortunately, it does not create a complete structure.
Am going to try and write something myself :) Shuold be something in the .NET framework I guess.
Cheers guys!
No.6 | | 163 bytes |
| 
It depends on the types of the nodes. If the nodes are optonal they usually dont get created. Have you tried to use the Validate Instance Functionality afterwards?
No.7 | | 407 bytes |
| 
Hey Sgt-Peppa,
Yeah, I tried to validate afterwards and the XML instance is not valid... e.g. some of the data should only be 10 long, but XML-Spy just ignores this and puts in a long decimal number!
I also selected for the instance to be generated with both mandatory and non-mandatory data, but it just ignores it.
Not really doing its job. :(
Cheers for tips though.
No.8 | | 233 bytes |
| 
chuddy -
I need to do the same thing - read an XSD and then create XML (nodes) based on the XSD, just like XML Spy.
Did you ever solve this?
Am I going to have to write my own XSD pareser?
Thanks.