September 2005 Archives

Aftermatch thoughts on XLinq

| 1 Comment | No TrackBacks | ,

I finally got some time (18 hours in a plane to Seattle :) to settle down my mind about XLinq. Erik Meijer's excellent article, which explains XLinq from functional programming point of view made me changing my mind on some issues I wrote earlier, some hands on experience and some comments from smart readers helped me to see a bigger picture.

What XLinq misses

| 3 Comments | No TrackBacks | ,

XLinq is at early stages, but what else would I like to see in XLinq? Here are my crazy wishes.

  • Shortcuts. In C# I need book["title"] instead of book.Element("title").
  • last() and position()
  • Literal XML just like in C-omega, not "kinda pseudo XML literals" like in VB9.
  • Fine control over serialization just like in XQuery
  • XPath support. I know it anyway and many do, so why to learn any new way to select nodes in XML tree? XPath is small, concise and intuitive. I want to write less code, so XPath is the way to go.

On XML expanded names in XLinq

| 2 Comments | No TrackBacks | ,

Dave Remy writes about XName and expanded names in XLinq and he wants feedback. Here we go.

Nodes in XLinq overload ToString() method to provide pretty-printed outer XML representation. At the same time nodes contain (familiar for MSXML users and new for .NET users) readonly Xml property, which returns raw (not pretty-printed) outer XML representation. At also at the same time casting element to a string returns element's value (string value with no angle brackets). There are also WriteTo() methods and Save() methods to complete the picture. I believe that's unnecessary confusing. Not only cast to string and ToString() do completely different things, but also there are many different ways of serializing nodes.

In XLinq XML Tree is exposed in a heterogenos way, that is nodes in a tree don't belong to a common type. Traditionally XML tree models are homogeneous, e.g. in DOM every node belongs to a specific kind of XmlNode class. But in XLinq attributes and text nodes aren't actually nodes. Instead attributes are just name-value properties of element nodes and text nodes while being internally normal nodes, never get exposed as such, but only as values they contain, so in effect what you can get out of XLinq tree is XNode (XElement etc), XAttribute and String values (which you can cast to appropriate CLR types). Apparently the goal was to simplify API and data model comprehension for users.

Erik Meijer:

XLinq: XML Programming Refactored (The Return Of The Monoids)

I just posted my XML 2005 submission about XLinq on my homepage.
It describes the XLinq API in somewhat detail, and informally explains the relationship between LINQ and monads.
That's really good one.

[Via Lambda the Ultimate]

MVP Summit

| 1 Comment | 1 TrackBack |

I'll be at the Microsoft MVP Summit in Redmond next week. I'm Microsoft MVP for second year, but that's going to be my first MVP Summit. That should be fun.

XLinq is new and hot technology everybody seems to be happy with. I'm going to post a different review series - not what I like, but what I dislike and want to be fixed in XLinq. Sorry in advance for bitter words, but it's better when your friend says them.

XML functional construction

XLinq.Net

| 3 Comments | No TrackBacks | ,

Being excited about XLinq I couldn't stop myself from grabbing XLinq.NET domain name. I'm going to try to build a community portal for the XLinq technology. The goal is basically to push XLinq by growing a community around it. There is definitely a need for Microsoft-independent easily accessible place where developers can find XLinq resources or share their experience.
Well, that's my vision at the moment. There is not much content at the site currently, just basic info and links. If you've got any ideas/suggestions about what would like to find at XLinq.Net, please drop me a line.

Hmm, according to Stan Kitsis there is at least 6 ways to associate an XML Schema with an XML document in Visual Studio 2005:

1. Schemas Property on your XML document
2. Inline inside your XML document
3. xsi:schemaLocation or xsi:noNamespaceSchemaLocation attributes in your XML document
4. Open Document Window.
5. Anywhere in your current Project
6. In the Schema Cache Directory or from a Schema Catalog file.
Is it actually sane? Now I can easily imagine a situation when I cannot be sure against which XML Schema file I'm validating my documents. Lots of flexibility, too much or just right? What is your take?

Microsoft's paper about "the experiences and the challenges in implementing XQuery in Microsoft's SQL Server 2005" is available here.

[Via Michael Rys]

xml:id went W3C Recommendation

| No Comments | No TrackBacks |

Little xml:id spec finally got W3C Recommendation status. I believe XML programming would be better be xml:id done in 1998, not in 2005. Anyway. xml:id provides a mechanism for annotating elements with unique identifiers. You just set xml:id attribute for an element and you done, no need for DTD, XML Schema or anything else:

<catalog>
    <book xml:id="b101">...</book>
    <book xml:id="b102">...</book>
    <book xml:id="b102">...</book>
</catalog>
Having elements annotated with IDs you can query them (usually very fast and efficiently) by ID values using various XML API specific means - GetELementById() in DOM, id() function in XPath/XSLT/XQuery, XPathNavigator.MoveToId() etc.

Upgraded to MT 3.2

| No Comments | No TrackBacks |

This is a repetitive pattern: once in a 6 months I get tired of comment and trackback spam and go upgrade my blog engine or install some antispam plugins.This time is not different. I've been massively attacked by spam trackbacks so I had to upgrade to MovableType 3.2. Not without a troubles though. Somehow it just didn't work after upgrade, but happily I found a solution at the MT support forum. Now all comments/trackbacks I get are subject to junk filtering and manual approvement.

I chose this strategy: each comment/trackback goes into unapproved queue and never makes it into a live page (except for authenticated comments). I get mail notifications for each comment/trackback and if I see not a spam one I approve it in just one click, spam ones I don't touch. Once in a week or so I go to blog admin and junk/delete all unapproved stuff again in a couple of clicks. Not that I love it, but still I can live with it.

We've heard about XML penetration into C#, Java and SQL. Now it seems like 45-years old programming language, 75% of worlds's business apps is written in is ready to adopt XML. I'm talking about Cobol, yeah baby! In the "XML and the New COBOL" article at webservicessummit.com Barry Tauber explains proposed forthcoming standard that will add native XML support to the Cobol language. IBM, HP and MicroFocus are behind this move, so chances are good.

And btw I'm currently working with Fujitsu NetCobol, which is .NET based Cobol and as such has full access to the .NET XML processing facilities. Not bad approach too!

Little Catherine gets first chair

| No Comments | No TrackBacks |



First chair for Catherine. Too big one, but not for long!

C# 3.0 chat with C# team

| 1 Comment | 1 TrackBack | , ,

That's an interesting chat:

C# 3.0 Language Enhancements
Description: Can't attend PDC but still want to talk to the C# team? This chat is your chance! Join the C# team to discuss the newly announced C# 3.0 features like extension methods, lambda expressions, type inference, anonymous types and the .NET Language Integrated Query Framework. You've been hearing rumblings about this for a while, now we finally talk in depth about the future of the C# language.

Add to Calendar
September 22, 2005
1:00 - 2:00 P.M. Pacific time
Additional Time Zones

Little known Visual Studio facts

| 2 Comments | No TrackBacks |

Here are some amazing facts about Microsoft Visual Studio:

  • Visual Studio 2005 will have 2700 commands that come from Microsoft alone, 800 of them - shared ones
  • Visual Studio is well factored into 250 basic packages
  • Visual Studio is the base for 36 SKU's
  • Visual Studio 2003 shipped with 358 keyboard shortcuts
  • 410 commands shipped in Visual Studio 2003 have no names
  • Visual Studio client teams are using 11 different tree controls, 9 different wizard frameworks, 15 custom tooltip controls
  • Visual Studio and Office have a different application font than Windows
  • Visual Studio has nearly 6000 images
  • In Visual Studio 2005 2900 of these images will be upgraded from 16 color to 32bit color
[From "Visual Studio 2005 UI Guidelines", available with VSIP SDKs].

XQuery in 10 min

| No Comments | No TrackBacks | ,

Stylus Studio Team has published "Learn XQuery in 10 minutes" article by Mike Kay. Smells like Stylus Studio commercial, but anyway good intro to XQuery.