Questions tagged [xsd.exe]

The XML Schema Definition (Xsd.exe) tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly. It is a part of the Microsoft .NET SDK.

References

346 questions
16
votes
5 answers

How to generate a List instead of an array in C# with xsd.exe

I have an XML schema .xsd file and generate my file with all the C# classes with the xsd.exe tool. If I have a sequence of elements within an XML tag, that would be represented in C# with an array. The fail is obvious. How can I generate Lists…
Gero
  • 12,993
  • 25
  • 65
  • 106
15
votes
4 answers

XmlSerialization and xsi:SchemaLocation (xsd.exe)

I used xsd.exe to generate a C# class for reading/writing GPX files. How do I get the resultant XML file to include the xsi:schemaLocation attribute eg. I want the following but xsi:schemaLocation is always missing
David Hayes
  • 7,402
  • 14
  • 50
  • 62
14
votes
3 answers

How to read XML into a class/classes that matches its xsd

So I have an XSD and a webservice that delivers in that same format. Now I could go ahead and read the xml into a document, create my objects from the class etc... But I am thinking, there must be some easier way to do that. Am I right? ;) Yahoo…
Kjensen
  • 12,447
  • 36
  • 109
  • 171
14
votes
2 answers

Is there an XSD for XSD's, a Meta-XSD?

Does there exist an Xml schema that will validate other XML schemas? What I want to do is take such a meta-schema (if it exists) and run it through XSD.EXE so that I can use C# classes to read an arbitrary XML schema and analyze it.
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
13
votes
3 answers

Classes Generated with XSD.exe Custom Class Names

Is it possible to have any control over the class names that get generated with the .Net XSD.exe tool?
Steve Horn
  • 8,818
  • 11
  • 45
  • 60
13
votes
2 answers

XSD tool appends "Specified" to certain properties/fields when generating C# code

I got a strange behaviour with the XSD generator I can't really explain. I got an XSD like this:
DerApe
  • 3,097
  • 2
  • 35
  • 55
12
votes
2 answers

xmlserializer validation

I'm using XmlSerializer to deserialize Xml achives. But I found the class xsd.exe generated only offers capability to read the xml, but no validation. For example, if one node is missing in a document, the attribute field of the generated class will…
Roy
  • 2,313
  • 6
  • 37
  • 46
12
votes
1 answer

Can we control type name in xsd.exe tool generated class

xsd.exe tool generates classes for given xsd file. It follows a pattern for naming the type. For example, xsd.exe /c…
Manikandan
  • 673
  • 3
  • 12
  • 26
12
votes
4 answers

Trouble with XML Deserialization into XSD generated classes

I have a rather detailed xml file. Below is the top level nodes (I have included the ellipse as the lower level nodes are all well formed and properly filled with data): ...
gun_shy
  • 485
  • 2
  • 7
  • 17
10
votes
2 answers

XSD Gen Classes That Reference a Common Type

I am using XSD's to define my DTO types in C#. I am using XSD.exe to gen the classes from the XSD's. I have a Common.xsd that defines an Address type and I want to use this in more than one class:
RobertMS
  • 1,153
  • 11
  • 17
10
votes
2 answers

Cannot generate classes because no top-level elements with complex type where found

I am trying to create a class from a xsd file using the XSD.EXE tool. but for some reason i get this error. Warning: cannot generate classes because no top-level elements with complex type were found. I have looked around on stack and seen that…
Code_Viking
  • 618
  • 1
  • 8
  • 26
10
votes
3 answers

AutoMapper and is*Specified properties

I have a bunch of XSD.exe-generated data contract classes which for all optional elements have a pair of C# properties like int Amount {get; set;} bool isAmountSpecified {get; set;} On the other side of mapping arena I have a nullable int like int?…
Igor Brejc
  • 18,714
  • 13
  • 76
  • 95
9
votes
2 answers

XML Serialization of the default values of optional attributes

I have a set of classes build using xsd.exe, and I am trying to serialise them. However, an attribute is not being included in the resulting XML. Here is part of the schema where the problem lies.
Jason
  • 2,940
  • 2
  • 21
  • 34
8
votes
2 answers

Pascal case class names when generating code with Visual Studio xsd.exe

Title pretty much says it all. VS xsd.exe creates classes in camel case. Is there a way of generating the classes in pascal case? If not does anyone know of a good tool to convert a load of class names from camel case to pascal…
jcvandan
  • 14,124
  • 18
  • 66
  • 103
8
votes
3 answers

Generate a class from xsd file in net core

I need to generate a class from an xsd in net core. In dotnet standard I used commandline xsd filename.xsd /c. But how to I create this class in net core. Anyone knows how to do this? When I add a class generated with xsd.exe I get several…
joakimja
  • 2,707
  • 2
  • 17
  • 25
1
2
3
23 24