InfoQ

News

LINQ to XSD is Back

Posted by Jonathan Allen on Feb 25, 2008 11:06 PM

Community
.NET
Topics
Data Access,
XML Databinding
Tags
LINQ,
XSD

Like LINQ to XML, LINQ to XSD is a provider for querying XML data. But unlike the former, LINQ to XSD is designed to be type safe. As the name implies, it used XSD files to generate strongly typed classes.

LINQ to XSD is especially important to C# developers who currently have to sprinkle their XML code with type casts. (VB developers can side step this with Option Strict Off.) An example of this can be seen in Fabrice's weblog:

//LINQ to XML
from item in purchaseOrder.Elements("Item")
select (double)item.Element("Price") * (int)item.Element("Quantity")

//LINQ to XSD
from item in purchaseOrder.Item
select item.Price * item.Quantity

LINQ to XSD was last available for VS 2008 Beta 1, a version that was incompatible with later betas.

2 comments

Reply

XML in VB by Stefan Wenig Posted Feb 26, 2008 4:51 AM
Re: XML in VB by Stefan Wenig Posted Feb 26, 2008 4:52 AM
  1. Back to top

    XML in VB

    Feb 26, 2008 4:51 AM by Stefan Wenig

    It should be noted that VB already supports this (and more, like axis operators) via the import statement: Imports It's therefore not necessary to rely on option strict off when using VB9 to access schema-typed XML. My new favorite DSL for XML access ;-)

  2. Back to top

    Re: XML in VB

    Feb 26, 2008 4:52 AM by Stefan Wenig

    Oh my, infoq is XML-aware too and "intelligently" adds closing tags...

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.