No you would need to strip out the XSD 1.1 specific parts.
You could try Liquid XML Objects which is a direct replacement for xsd.exe and support XSD 1.1.
It is commercial product but small XSD can be used under the free community edition license.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
there is a way to generate C# class from XSD 1.1?
i can't transform the XSD 1.1 to 1.0, there is a tool for generate the clases direct from an XSD 1.1?
i know there is XSD.exe but not recognises "assert" from XSD 1.1
No you would need to strip out the XSD 1.1 specific parts.
You could try Liquid XML Objects which is a direct replacement for xsd.exe and support XSD 1.1.
It is commercial product but small XSD can be used under the free community edition license.
If XSD.exe does not apply to the current file, then I am afraid you need to manually convert it to a class.
The xsd file is a special xml file. There are many ways to read it in C#, such as:
static void Main(string[] args)
{
XmlTextReader reader = new XmlTextReader(@"C:\Users\timony\Desktop\1.xsd");
XmlSchema myschema = XmlSchema.Read(reader, ValidationCallback);
}
static void ValidationCallback(object sender, ValidationEventArgs args)
{
if (args.Severity == XmlSeverityType.Warning)
Console.Write("WARNING: ");
else if (args.Severity == XmlSeverityType.Error)
Console.Write("ERROR: ");
Console.WriteLine(args.Message);
}
Or
var xsd = XDocument.Load(@"C:\Users\timony\Desktop\1.xsd");
var ns = xsd.Root.GetDefaultNamespace();
var prefix = xsd.Root.GetNamespaceOfPrefix("xsd");
var vehicle = xsd.Root.Element(prefix + "complexType");
var sections = vehicle.Element(prefix + "sequence")
.Elements(prefix + "element").ToList();
Then assign the value of each element to the properties of the class you created.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.