PDA

Click to See Complete Forum and Search --> : Xml


chuddy
Apr 26th, 2006, 02:26 PM
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!

penagate
Apr 26th, 2006, 08:46 PM
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)

chuddy
Apr 27th, 2006, 07:35 AM
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!

penagate
Apr 27th, 2006, 07:37 AM
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? :)

Sgt-Peppa
Apr 27th, 2006, 08:26 AM
...
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

chuddy
Apr 27th, 2006, 10:41 AM
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!

Sgt-Peppa
Apr 27th, 2006, 11:30 AM
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?

chuddy
Apr 27th, 2006, 12:37 PM
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.

wayneh
Nov 20th, 2006, 10:33 AM
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.