xsd.exe

Programmatically use XSD.exe tool feature (generate schema from class) through .NET Framework classes?

依然范特西╮ 提交于 2019-11-30 20:19:30
I want to generate an XML Schema based upon a class, just as you can do with the Xsd.exe tool . E.g. xsd.exe /type: typename /outputdir:c:\ assmeblyname . Is there a way to do this by using classes in the .NET Framework instead of using the standalone tool? I'm sure I've seen information about task references or similar - i.e. something programmatic - that can be used in place of some of these standalone utilities, or that some standalone utilities get their features through the FCL or a Microsoft API. Found this which looks like it should do the trick... public static string GetSchema<T>() {

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

白昼怎懂夜的黑 提交于 2019-11-30 20:02:58
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 i could put a type on the complex type element but i cannot seem to get i to work. here is the xsd file <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"

Trouble with XML Deserialization into XSD generated classes

China☆狼群 提交于 2019-11-30 12:37:45
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): <?xml version="1.0" encoding="UTF-8"?> <config> <Models>...</Models> <Data>...</Data> </config> I have created an xsd file from using the Visual Studio 2008 command prompt: xsd sample.xml This generates the xsd file just fine. I then auto generate classes from the xsd with the command: xsd sample.xsd /classes For the deserialization of the xml file into a class object, I'm using the read function in the helper class: public

XSD.exe and “Circular Group references”

女生的网名这么多〃 提交于 2019-11-30 07:25:47
问题 I am attempting to build some classes so that I can deserialise an XML file created by a third party application. Luckily the developer of the 3rd party application included a schema file with their code so that the XML file can be understood. When I use the XSD.exe tool from Visual Studio the process fails reporting the following error "Group 'SegGroupOrSegmentGrouping' from targetNamespace='' has invalid definition: Circular group reference." Any help in how I can generate the class files

Programmatically use XSD.exe tool feature (generate schema from class) through .NET Framework classes?

…衆ロ難τιáo~ 提交于 2019-11-30 04:02:16
问题 I want to generate an XML Schema based upon a class, just as you can do with the Xsd.exe tool. E.g. xsd.exe /type: typename /outputdir:c:\ assmeblyname . Is there a way to do this by using classes in the .NET Framework instead of using the standalone tool? I'm sure I've seen information about task references or similar - i.e. something programmatic - that can be used in place of some of these standalone utilities, or that some standalone utilities get their features through the FCL or a

Trouble with XML Deserialization into XSD generated classes

ぐ巨炮叔叔 提交于 2019-11-29 18:18:55
问题 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): <?xml version="1.0" encoding="UTF-8"?> <config> <Models>...</Models> <Data>...</Data> </config> I have created an xsd file from using the Visual Studio 2008 command prompt: xsd sample.xml This generates the xsd file just fine. I then auto generate classes from the xsd with the command: xsd sample.xsd /classes For the

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

*爱你&永不变心* 提交于 2019-11-29 09:34:16
I got a strange behaviour with the XSD generator I can't really explain. I got an XSD like this: <xs:complexType name="StageSequenceElement" mixed="false"> <xs:complexContent> <xs:extension base="CoreObject"> <xs:sequence> <xs:element name="Description" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>Some Doc</xs:documentation> </xs:annotation> </xs:element> <xs:element name="StageRef" type="ObjectReference"> <xs:annotation> <xs:documentation>...</xs:documentation> </xs:annotation> </xs:element> <xs:element name="MinDuration_100ms" type="xs:int" nillable="true" minOccurs="0">

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

杀马特。学长 韩版系。学妹 提交于 2019-11-29 03:56:39
xsd.exe tool generates classes for given xsd file. It follows a pattern for naming the type. For example, <Students> <Student Name="A" RollNo="1" Address="Some Address"> <Department Id="20" Name="CSE"/> </Student> </Students> xsd.exe /c Students.xsd Students.cs file is generated. If we see the type for elements Element Type Name Students Students Student StudentsStudent Department StudentsStudentDepartment It generates type by prefixing the parent element name if the element is child. Can we control this name? I need the type name as same as element name. Student => Student, Department =>

XSD.exe and “Circular Group references”

三世轮回 提交于 2019-11-29 03:13:00
I am attempting to build some classes so that I can deserialise an XML file created by a third party application. Luckily the developer of the 3rd party application included a schema file with their code so that the XML file can be understood. When I use the XSD.exe tool from Visual Studio the process fails reporting the following error "Group 'SegGroupOrSegmentGrouping' from targetNamespace='' has invalid definition: Circular group reference." Any help in how I can generate the class files in light of this error would be appreciated. A copy of the schema file can be found here : schema file I

using xsd.exe to generate c# files, getting error and warnings

瘦欲@ 提交于 2019-11-29 02:01:47
问题 This is the command i'm running: xsd.exe -c -l:c# D:\Documents\DEV\SARPilot\Docs\schemas\06-141r2\06-141r2.xsd These are the errors i'm getting: Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 2.0.50727.3038] Copyright (C) Microsoft Corporation. All rights reserved. Schema validation warning: Undefined complexType 'http://www.opengis.net/sps/0:ParameterDescriptorType' is used as a base for comp lex type extension. Line 617, position 2. Schema