xsd2code

XSDObjectGen.exe vs XSD.exe

↘锁芯ラ 提交于 2019-12-28 02:45:51
问题 Can anyone tell me what is the difference between XSDObjectGen.exe & XSD.exe? Is there any way to make XSDObjectGen.exe work in dot net 2.0? 回答1: As an alternative, there's Xsd2Code. Some features: Generate partial class. Support generic and custom collection (List, ObservableCollection, MyCustomCollection). Support automatic properties when no special get or set is required. Can generate WCF attributes (DataContract/DataMember). Support nillable type. Mask private field in IDE (use

Xsd2Code and xmldsig

為{幸葍}努か 提交于 2019-12-24 10:34:06
问题 I have a problem with generating code from xsd with Xsd2Code. The xsd looks like this: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:ns1="urn:oasis:names:specification:ubl:schema:xsd:CountryIdentificationCode-1.0" xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:LocationIdentificationCode-1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http:/

JAXB class ref prevent enum generation

此生再无相见时 提交于 2019-12-13 07:29:12
问题 I've found this QA already and was able to prevent the generation of classes, but enums are still generated. I've tried to prevent it with custom binding: <jxb:bindings node="//xs:simpleType[@name='myEnum']"> <jxb:class ref="com.myapp.enums.MyEnum" /> </jxb:bindings> but it is not working for me. Is there any possibility to prevent the generation of enums or maybe another customization? 回答1: You must use following snippet <jxb:bindings node="//xs:simpleType[@name='myEnum']"> <jxb

XSD Class generators: keeping track of element order

喜欢而已 提交于 2019-12-13 00:08:18
问题 I got the following complex type within my XSD schema <xs:complexType name="structure" mixed="true"> <xs:choice maxOccurs="unbounded"> <xs:element type="b" name="b" /> <xs:element type="a" name="a" /> </xs:choice> </xs:complexType> which allows me to state XML definitions like this: <structure> Hello <b>World</b> Hello 2 <b>World 2</b> <a>Hello3</a> <b>World3</b> </structure> Now I tried to generate XSD classes out of my schema, I tried both XSD.exe as well as XSD2Code. They both generate

xsd2code creates extra nested collection when serializing lists

纵饮孤独 提交于 2019-12-12 02:15:35
问题 I've been using xsd2code v3.4. So far I'm pretty close to getting it to work, however I'm facing one glaring issue and I can't seem to find any solutions. When my XML gets generated after I serialize my object, it's adding an additional complex type that is named exactly like the class. This is what I currently get. Notice how it's adding an unnecessary collection right after an order line: <?xml version="1.0" encoding="utf-8"?> <CORE_PO_INBOUND_V2 xmlns:xsd="http://www.w3.org/2001/XMLSchema"

How to use XSD2CODE generated C# classes

旧时模样 提交于 2019-12-11 05:48:08
问题 I am new to XSD world, I worked with XML but not much programtically. I have successfully generated C# classes using XSD2Code.Can somebody please guide me how can I use those generated classes using C# and use my XML to get validated. Code snippet would be hightly appreciated. Thanks and regards. 回答1: Validating an XML does not need to have the generated classes. Lets see this helper class: public class Validator { XmlSchemaSet schemaset; ILog logger; static Validator instance; static object

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 =>

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

a 夏天 提交于 2019-11-27 18:04:13
问题 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

How to convert XSD to Python Class [closed]

百般思念 提交于 2019-11-27 07:33:31
I just want to know if there is a program that can convert an XSD file to a Python class as JAXB does for Java? Kortex786 generateDS : I think this is the good tool I need Edit : Actually, generateDS does very well the job !! It generates the Python class with all methods (setters and getters, export to XML, import from XML). It works very well ! PyXB: http://pyxb.sourceforge.net/ Look at http://pypi.python.org/pypi/rsl.xsd/0.2.3 Also, you might want http://pyxsd.org/ it works very nicely. 来源: https://stackoverflow.com/questions/1072853/how-to-convert-xsd-to-python-class

How to convert XSD to Python Class [closed]

℡╲_俬逩灬. 提交于 2019-11-26 13:28:49
问题 I just want to know if there is a program that can convert an XSD file to a Python class as JAXB does for Java? 回答1: generateDS : I think this is the good tool I need Edit : Actually, generateDS does very well the job !! It generates the Python class with all methods (setters and getters, export to XML, import from XML). It works very well ! 回答2: PyXB: http://pyxb.sourceforge.net/ 回答3: Look at http://pypi.python.org/pypi/rsl.xsd/0.2.3 Also, you might want http://pyxsd.org/ it works very