Fridathon: unstructured learning or hacking you can opt-in to do on any random Friday.
  • XmlSerializer and open content models

    Using the built-in code generation features (let’s say xsd.exe or the approach I’ve outlined), the generated classes use the System.Xml.Serialization.XmlAnyElementAttribute and System.Xml.Serialization.XmlAnyAttributeAttribute to capture the foreign elements and attributes in an instance document. Unfortunately, this is not enough. [Read More]
  • Do you dare?

    Every now and then I smash against Dare’s opinions such as this one or that one orhis final word on the matter . And everytime I do, the more he becomes an important independent, objective and qualitative voice for me, and the less I think of him as a MSftie (although he joined pretty recently). I hope he has a long career inside MS. More minds like his inside there and the positive signs we see here and here may spread, and turn MS into a company we can love, instead of looking at it with distrust, with our back... [Read More]
  • Evolving existing APIs in backwards-compatible way (i.e. SOM and DOM)

    A couple days ago I posted about the inconvenience of an API that is designed to expose augmented data depending on its state. This is the case for the XmlSchema Object Model (SOM) in .NET and its Post-compilation infoset (PCI), as well as the DOM and its Post-schema validation infoset (PSVI). Dare Obasanjo aknowledged this issue, but is resigned, saying it’s too late to fix any of this. [Read More]
  • Do you need another reason to avoid "sp_" prefix?!

    Note: Do not preface your stored procedure names with sp_, because doing so reduces performance. When you call a stored procedure that starts with sp_, SQL Server always checks the master database first, even if the stored procedure is qualified with the database name. [Read More]
  • VS.NET Xml Intellisense and Schemas

    As most people know, in order to get intellisense for an “xmlnamespaced” document inside the IDE, the schema defining that namespace either has to be in the same project/folder or in c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml (default VS installation folder). Therefore, if you have multiple projects, where one of them provides the schemas and another uses them in a document, you have to duplicate the file into the VS folder, and then you can forget copying it back when you change it in the project, etc… a mess. [Read More]
  • Strange bug in XML Serialization/Mapping classes

    While trying to customize the generated code for an XmlSchema, using the technique explained in a previous post, I came to a point where I can’t advance any further as the framework classes are throwing an exception where they shouldn’t. The customization process basically involves using the XmlSchemaImporter class and using its ImportTypeMapping() method. To further customize it, I wanted to modify the type members, therefore, I tried to use the ImportMembersMapping() with exactly the same (working) XmlQualifiedName used for the previous method. I got an InvalidCastException thrown in the face :S. Here’s the damn stack trace: [Read More]
  • RssBandit Rocks!

    Finally, RssBandit no longer freezes, it works flawlessly, is full featured and a real pleasure to use. It’s my new default reader (goodbye SharpReader!!!) And Roy, I must say you’re wrong. You need to have a look at the latest version. Well done Dare!! [Read More]
  • XmlSerializer and IXmlSerializable: automatic XSD validation please!

    The IXmlSerializable interface allows you to take full control of the XML serialization of your class whenever the XmlSerializer is used. It will check for this interface, and if it finds it, it will use its methods for the serialization, instead of reading the serialization attributes, etc. The interface has the following definition: [Read More]