xsd.exe

Create MULTIPLE class files based on an XSD

百般思念 提交于 2019-12-03 23:41:20
问题 I may be attempting something that is not possible with the XSD tool but I wanted to ask before moving on to a simpler solution. I have an XSD file that has multiple elements (and multiple complex types) that will generate multiple classes in one code file (I do not like this). For the sake of having clean and readable class files generated from the XSD tool, I would like for each element to be placed in a seperate code file, not all placed in one code file as partial classes. Does anyone

Generating an XSD file with xsd.exe tool from an XML file with multiple namespaces

前提是你 提交于 2019-12-03 16:21:15
What I want to do: I am trying to generate an XSD file for an existing XML file. I'm using the xsd.exe tool (shipped with Visual Studio). Some of the elements in the XML file are namespace-qualified. In some cases local names are the same, just as below: <images> <icons> <icon url="http://www.icons.com/logo.png"/> </icons> <foo:icons> <foo:foo_icon url="http://www.foo.org/pic.ico"/> </foo:icons> </images> What I am getting: Calling xsd.exe myfile.xml gives me an error: Cannot add a column named 'icons': a nested table with the same name already belongs to this DataTable. OK but that's what the

Is the “xsd” command not supported in Visual Studio 2012 command window?

不打扰是莪最后的温柔 提交于 2019-12-03 14:50:55
问题 I've read that it is possible to run xsd commands right in visual studio (2010). I have VS 2012 on my machine and when I run xsd XMLFile.xml I get Command "xsd" is not valid. So, is the "xsd" command not supposted in VS 2012 and is there any other way to execute "xsd" in VS 2012? 回答1: xsd.exe is available from the 'Developer Command Prompt for VS2012, not the command window that is part of the VS2012 IDE. The 'Developer Command Prompt for VS2012' itself can be started from Start Menu -> All

xsd.exe output filename

笑着哭i 提交于 2019-12-03 14:38:16
问题 Is there a way to control the output filename from xsd.exe? My specific issue is that if an imported xsd is referenced this is added to the filename. 回答1: This link suggests another alternative ... using a path character in specifying the input schemas resets the generated file name. So if you use the following you will be able to control your output file name. xsd.exe schema1.xsd schema2.xsd .\schema3.xsd Will force xsd.exe to generate the schema3.cs file. Note: It's a hack but up to now (VS

Is the “xsd” command not supported in Visual Studio 2012 command window?

有些话、适合烂在心里 提交于 2019-12-03 04:35:50
I've read that it is possible to run xsd commands right in visual studio (2010). I have VS 2012 on my machine and when I run xsd XMLFile.xml I get Command "xsd" is not valid. So, is the "xsd" command not supposted in VS 2012 and is there any other way to execute "xsd" in VS 2012? xsd.exe is available from the 'Developer Command Prompt for VS2012, not the command window that is part of the VS2012 IDE. The 'Developer Command Prompt for VS2012' itself can be started from Start Menu -> All Programs -> Microsoft Visual Studio 2012 -> Visual Studio Tools -> Visual Studio Command Prompt For VS2012

xsd.exe output filename

此生再无相见时 提交于 2019-12-03 04:23:55
Is there a way to control the output filename from xsd.exe? My specific issue is that if an imported xsd is referenced this is added to the filename. This link suggests another alternative ... using a path character in specifying the input schemas resets the generated file name. So if you use the following you will be able to control your output file name. xsd.exe schema1.xsd schema2.xsd .\schema3.xsd Will force xsd.exe to generate the schema3.cs file. Note: It's a hack but up to now (VS 2010) it works. xsd.exe will automatically choose the output name of the file based on the input file name.

XSD Gen Classes That Reference a Common Type

ⅰ亾dé卋堺 提交于 2019-12-03 02:52:08
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: <xs:complexType name="Address"> <xs:sequence> <xs:element name="Street1" type="xs:string"/> <xs:element name="Street2" type="xs:string"/> <xs:element name="City" type="xs:string"/> <xs:element name="State" type="xs:string"/> <xs:element name="Zip" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:element name="Address" type="mhm:Address"/> I am referencing this in a company XSD: <xs:include

Is svcutil.exe a replacement for xsd.exe?

北战南征 提交于 2019-12-02 17:35:27
I am using xsd.exe to generate some c# classes from a .xsd file. I ran into the same issue that is covered here and on other sites where xsd.exe generates Type[] arrays instead of generic List collections for types in the .xsd file. Some people have suggested that svcutil.exe can be used as a replacement for xsd.exe if you pass the /dataContractOnly parameter to svcutil.exe. However, it seems like those people are mistaken because svcutil.exe actually generates System.Xml.XmlNode[] array properties instead of creating types based on the schema in the .xsd file. For example, given this simple

C# how can I debug a deserialization exception?

喜夏-厌秋 提交于 2019-12-02 05:51:32
问题 I havve created a C# class representing an XSD using the XSD.exe tool. I use a valdiation code to check the consistency of the XML with the XSD. I got this working, but using another XML file causes exceptions. The XML files are produced by an external program and I do not have access to the original code or to a published XSD. During reading the XML during Deserialization I get an exception: enter System.InvalidOperationException was unhandled HResult=-2146233079 Message=Het XML-document

C# how can I debug a deserialization exception?

孤街醉人 提交于 2019-12-02 02:10:29
I havve created a C# class representing an XSD using the XSD.exe tool. I use a valdiation code to check the consistency of the XML with the XSD. I got this working, but using another XML file causes exceptions. The XML files are produced by an external program and I do not have access to the original code or to a published XSD. During reading the XML during Deserialization I get an exception: enter System.InvalidOperationException was unhandled HResult=-2146233079 Message=Het XML-document (235, 17) contains an error. The error is described as an attempt to convertt a string to a DateTime