Jump to content

Create a sample XML from an XSD


 Share

Recommended Posts

I was wondering if anyone has come across some dos command tool or even developed it in Autoit that will create an XML after choosing an XSD. Basically the XML will have all the required fields for it validate and all the optional elements as well. Thanx.

Link to comment
Share on other sites

I was wondering if anyone has come across some dos command tool or even developed it in Autoit that will create an XML after choosing an XSD. Basically the XML will have all the required fields for it validate and all the optional elements as well. Thanx.

Maybe I don't understand what you are requesting, but there is no way to create an XML file from an XSD file, without any data (and you did not mention where those data shall come from!). The XSD file is just a schema description for the XML file, i.e. it contains the XML attribut names and the order of those. So, what is it you want to do?

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Maybe I don't understand what you are requesting, but there is no way to create an XML file from an XSD file, without any data (and you did not mention where those data shall come from!). The XSD file is just a schema description for the XML file, i.e. it contains the XML attribut names and the order of those. So, what is it you want to do?

Cheers

Kurt

The XML that will be created can have any bogus values (ie. a Name field can have the value "Name"). So the final product would be a program that would prompt you to browse to an XSD and shoot out an XML with all the attributes that are required plus the optional. I hope this helps.

Link to comment
Share on other sites

I hope this helps.

actually no. I'm still missing the data. Can you give an example? XSD file and generated XML file.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Sure..Here are one XSD sample that I found and an xml created from the XSD... Please let me know.

well, I don't know a tool that does what you want, as XSD schemas are usally used to check the validity of an XML file. Creating an empty XML file with some dummy data does not make much sense for me. Anyway, Microsoft offers a few tools to handle XSD file. Maybe they are usefull for you.

Sample Code Generator

XML Schema Definition Tool (Xsd.exe)

BTW: I still don't know why you would need the XML file with some "dummy" values.....

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

well, I don't know a tool that does what you want, as XSD schemas are usally used to check the validity of an XML file. Creating an empty XML file with some dummy data does not make much sense for me. Anyway, Microsoft offers a few tools to handle XSD file. Maybe they are usefull for you.

Sample Code Generator

XML Schema Definition Tool (Xsd.exe)

BTW: I still don't know why you would need the XML file with some "dummy" values.....

Cheers

Kurt

I tried using the Sample Code Generator but i am getting "Application handled error. Could indicate an issue with the schema .NET Framework XSD Schema compile error. Error occurred : Schema Validation Error: Undefined complexType 'ct_NameAddress' is used as a base for complex type extension". An error occurred at file:///C:/Program Files/XSDObjectGenerator/Base_v2.xsd, (426, 14)."

From where can I download the "XSD.exe" from the url=http://msdn2.microsoft.com/en-gb/library/x6c1kb0s(VS.80).aspx?

Is there a way to get a list of all the required & optional elements to create the sample xml from the xsd? Meaning if you choose an xsd then the program would shoot out a csv or some other file format with a list of all the elements that are required plus the optional.

Link to comment
Share on other sites

I tried using the Sample Code Generator but i am getting "Application handled error. Could indicate an issue with the schema .NET Framework XSD Schema compile error. Error occurred : Schema Validation Error: Undefined complexType 'ct_NameAddress' is used as a base for complex type extension". An error occurred at file:///C:/Program Files/XSDObjectGenerator/Base_v2.xsd, (426, 14)."

From where can I download the "XSD.exe" from the url=http://msdn2.microsoft.com/en-gb/library/x6c1kb0s(VS.80).aspx?

Is there a way to get a list of all the required & optional elements to create the sample xml from the xsd? Meaning if you choose an xsd then the program would shoot out a csv or some other file format with a list of all the elements that are required plus the optional.

XSDObjectGen.exe mail.xsd /n:MAIL /d /l:vb works on my system. However, the output won't help you any....

xsd.exe: as mentioned in the link. It's part ot the .Net Framework SDK 2.0 (not the Runtime 2.0 !!). ~ 300 MByte Download !!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...