It comes down to these cases for XML elements having maxOccurs="1" (which the default for maxOccurs):
adding nillable="true" will convert from a regular type to a nullable type.
adding minOccurs="0" will add boolean …Specified properties in the generated C# for each element.
you can have both nillable="true" and minOccurs="0" in an element which gets you a nullable type and a …Specified property.
Note I’m not considering fixed or default here, nor attributes (that have use instead of minOccurs/maxOccurs, but do not allow for nillable) nor larger values of maxOccurs (which both xsd.exe and xsd2code regard as unbounded).
From the above, XML has a richer type system than C#, so in XML there are subtle a differences between:
an explicit nil in the XML element
the XML element being absent
the XML element being empty.
Hopefully later more text and examples to show how to actually work with this.
A while ago I bumped into this interesting bit: LLLPG (Loyc LL(k) Parser Generator) is a new recursive-decent parser generator for C#, with a feature set better than ANTLR version 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
It is next to the “Project Dependencies” in this image from Sara Ford:
Sara Ford: change “Project Build Order”
In the resulting dialog, you can change the build order within your solution.
This can be very useful when – for various reasons – you cannot have Project Level dependencies for an assembly, but have to have Assembly Reference dependencies for individual assemblies.
At a client I bumped into this, and this dialog was a life saver for us.
I tend to forget this: xsd.exe can resolve xs:include, but not xs:import. When using xs:import it will complain about missing types.
Simple solution: reference all imported XSDs (but not included XSDs) on the same command-line:
I was trying to create a C# class with xsd.exe from an schema that imports others schemas like that xsd.exe /c schema.xsd and it fails miserably reporting an error like “The datatype ‘xxx’ is missing.”. Basically xsd.exe doesn’t resolve the schemaLocation attribute.
The solution isn’t very nice, but at least it’s simple. You have to tell xsd.exe all the schema referenced, xsd.exe /c schema.xsd importedSchema1.xsd importedSchema2.xsd
Be aware that the C# filename is sometimes generated from all XSD filenames on the command-line (I’ve noticed this when the import is specified before the actual XSD file, if the import is at the end, the name of the import is used.
If my memory serves me right, older versions of XSD.exe could not resolve unix-style relative paths on the command-line, but newer versions do.
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft services or updates for the software, except to the extent those have different terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
INSTALLATION AND USE RIGHTS.
Individual license. If you are an individual working on your own applications to sell or for any other purpose, you may use the software to develop and test those applications.
Organization licenses. If you are an organization, your users may use the software as follows:
Any number of your users may use the software to develop and test your applications released under Open Source Initiative (OSI) approved open source software licenses.
Any number of your users may use the software to develop and test extensions to Visual Studio.
Any number of your users may use the software to develop and test your applications as part of online or in person classroom training and education, or for performing academic research.
If none of the above apply, and you are also not an enterprise (defined below), then up to 5 of your individual users can use the software concurrently to develop and test your applications.
If you are an enterprise, your employees and contractors may not use the software to develop or test your applications, except for open source and education purposes as permitted above. An “enterprise” is any organization and its affiliates who collectively have either (a) more than 250 PCs or users or (b) more than one million US dollars (or the equivalent in other currencies) in annual revenues, and “affiliates” means those entities that control (via majority ownership), are controlled by, or are under common control with an organization.
Demo use. The uses permitted above include use of the software in demonstrating your applications.
The license continues, but the above are the most important aspect to verify if you can use Visual Studio 2015 under that license.
Anders Live – Build 2016 – Channel 9 Stage C907 – Speakers: Anders Hejlsberg, Seth Juarez
Anders explaining about being a pragmatist ever since he started working on the Turbo Pascal predecessor in 1981. It’s been a long way to TypeScript and beyond (:
Lot’s of interesting tidbits about the future of TypeScript and how it relates to other languages.