Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Dim doc As New XmlDocument
Dim sr As New System.IO.StreamReader("C:\foo.xml")
Dim xmlS As String = sr.ReadToEnd
sr.Close()
doc.LoadXml(xmlS)
Dim ds As DataSet = New DataSet
ds.ReadXml("C:\foo.xml")
ds.WriteXmlSchema("C:\foo.xsd")
works fine but obviously the XSD isnt the most useful thing in the world. i did it the other day as i wanted to generate a strongly typed dataset from some XML in a spec (no XSD provided)
xsd/?
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
xsd.exe -
Utility to generate schema or class files from given source.
Dim doc As New XmlDocument
Dim sr As New System.IO.StreamReader("C:\foo.xml")
Dim xmlS As String = sr.ReadToEnd
sr.Close()
doc.LoadXml(xmlS)
Dim ds As DataSet = New DataSet
ds.ReadXml("C:\foo.xml")
ds.WriteXmlSchema("C:\foo.xsd")
works fine but obviously the XSD isnt the most useful thing in the world. i did it the other day as i wanted to generate a strongly typed dataset from some XML in a spec (no XSD provided)
HTH
About as useful as a chocolate teapot unless you happen to want a typed dataset schema!
Really, a million schemas can represent one XML document. The best xsd tool is the human brain. It ain't hard, and it is much more likely to represent an intelligent schema representation of the XML document (assuming you know something about what the XML means and is to be used for), than these tools.
Comment