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
4
votes
1 answer

Pluralizing properties in generated code from xsd

I have an XSD describing the schema for some of my data contracts in an application I am building. I'm not the most experienced in writing xsd files, but so far nothing I've tried has been able to resolve my issue. I have a section of the schema…
Los Frijoles
  • 4,771
  • 5
  • 30
  • 49
4
votes
1 answer

How can I get automatic properties in my class generated from XSD?

Is there any way to get automatic properties in my class file that's generated from xsd? I am using Xsd2code and have tried the following command. c:\xsd2code q2test.xsd /n ContractXml /pl Net35 /ap[+] /xa[+] It doesn't generate automatic…
abhi
  • 3,082
  • 6
  • 47
  • 73
4
votes
1 answer

xsd.exe attribute order

My target is serialize c# classes to XML with attribute order like properties order in my classes. For this purporse I need add System.Xml.Serialization.XmlElementAttribute(Order=int) before other property in my class. …
Peter Barbanyaga
  • 496
  • 7
  • 16
4
votes
1 answer

Manually Create classes to map to XML Request Response

I have been assigned to implement an interface to an API that uses XML request/response. The API providers don't provide any xsd(s) for the XML calls. I generated the C# classes using xsd.exe: .xml -> .xsd -> .cs However, I did not find the…
bhootjb
  • 1,501
  • 1
  • 21
  • 33
3
votes
2 answers

How to work with different.xsd namespaces that contains the same elements/classes?

Im having a little trouble understanding how I should work with xml files, so I hope you guys can guide me in the right dirrection :) Hopefully I can explain my problem clear enough :) I have a lot of .xsd files which are all connected from top to…
Christian
  • 1,080
  • 1
  • 20
  • 37
3
votes
2 answers

Problem deserializing validated XML, can't convert to/from array

I'm a bit out of my element. I've used xsd.exe to create an xsd schema from an xml file, and then to create a C# class from that xsd. That all seems to work fine. At the moment I'm just trying to get the XML deserialized. The file I'm deserializing…
Asmor
  • 5,043
  • 6
  • 32
  • 42
3
votes
1 answer

Generate Nested Types instead of Global Types with xsd.exe

Using xsd.exe in a C# class, is there a way to produce a xsd file with Nested Type, instead of Global Types? I want to use this xsd file, with SSIS - Sql Server Integration Services, and look SSIS is not reading my xsd very well. I want to…
3
votes
1 answer

C#: Autogenerating DDL and ORM classes from XML schema (XSD) file

I have a rather large XSD file available here. I want to generate the following from the file: Generate DDL (for PostgreSQL), the DDL should contain initial values where appropriate, as specified by 'permitted' values in the XSD Generate an ORM…
oompahloompah
  • 9,087
  • 19
  • 62
  • 90
3
votes
1 answer

Xsd.exe generates buggy implementation of

This is an example of what Xsd.exe generates (also Xsd2Code but using generic List<>). /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd",…
Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169
3
votes
2 answers

Is it possible to use XSD tool from Mac OS?

I just started a project where I need to create a class to map all XML attributes from an XSD file. For those ones with a few attributes, it can be done manually. For those with a lot of attributes it will take some time to create the class. I found…
MikePR
  • 2,786
  • 5
  • 31
  • 64
3
votes
3 answers

Is there a tool to generate simple c# classes from an xsd?

I have an xsd (greatly simplified for this post):
Roger
  • 2,063
  • 4
  • 32
  • 65
3
votes
2 answers

How to use XSD.exe with attributeGroup ref

I'm having trouble using xsd.exe while using a attributeGroup with ref. I use it to generate C# classes. Here's my XSD:
smoksnes
  • 10,509
  • 4
  • 49
  • 74
3
votes
1 answer

Getting error when trying to generate xsd:schema using xsd.exe

I have a custom configuration section and i want to generate an xsd scheme using the xsd tool, however i get the following error : Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 4.0.30319.1] Copyright (C)…
Richard Friend
  • 15,800
  • 1
  • 42
  • 60
3
votes
4 answers

Are circular groups allowed by XSD schema?

For this xml: I have this schema, which seems to validate fine against w3 schema validation service, and the schema validates the above XML just fine.…
Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
3
votes
2 answers

How do I troubleshoot this exception when creating an XmlSerializer object?

I downloaded the XML Schema for XML Schemas at http://www.w3.org/2001/XMLSchema.xsd. I then used XSD.EXE to create a class from the downloaded file. I called the class schema.cs. I then executed this line of code: XmlSerializer serializer = new…
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501