June 8, 2003
@ 12:58 AM
Web 310: XML Schema What You Need To Know And Why

If you build XML Web Services using ASP.NET you might have realized that ASP.NET doesn't do schema validation of incoming SOAP messages according to the schema defined in the WSDL. This means that XML Web Services built using ASP.NET do not enforce the message contract out-of-the-box. My demo showed how to build a custom SoapExtension that performs schema validation of incoming SOAP messages before attempting to execute the web method. You can grab the demo here.

These are the accompanying slides.


Passing XML Data Inside the CLR

A little while ago I mentioned that I probably need to write a white paper on passing XML data between .NET Framework applications. It seems Don beat me to it with his MSDN TV spot entitled Passing XML Data Inside the CLR. Everything I probably would have written is in that TV spot. Actually that's not true. Don doesn't mention some of the issues that exist if one decides to go with the XPathNavigator interface such as those raised by Justin Rudd about XPathNavigator implementations not being easily convertible to a form other APIs in the .NET Framework may want to work with such as an XmlReader or a string representation of the XML.

The answer to Justin's issues are to use helper classes such as Aaron Skonnard's XmlReader wrapper for the XPathNavigator for enabling an XPathNavigator look like an XmlReader. I probably should pen a helper function that shows how to recursively walk an XPathNavigator and convert it to a string. I'll probably save that for my "System.Xml Tips & Tricks" column which I'll probably write in a few months.


The 'Don' of Web Services : A Guide to Clarity and Stability

I attended Don's keynote and liked most of what I saw. I didn't stay till the end because I had to go check out of my hotel (due to an annoying fuckup) but caught about half of it. As usual Don had no slides but did have an XML document (a SOAP request) which outlined his presentation. He also did a lot of coding and writing XML in Emacs which seems to dispute certain claims in his blog that he's started getting more comfortable with VS.NET. :)

The main points I remember were
  • It's all about XML. XML Web Services are about exchanging XML documents and if you want to use XML Web Services you should understand XML.

  • The XML 1.0 syntax is the base layer upon which the XML Infoset rests and from which we get "typed infosets". The XML 1.0 syntax is incidental what is actually important is infosets and typed infosets. I personally dislike the term "typed infoset" because it doesn't map to anything that has been formally described in any spec. That's why my team has slowly phased out using terminology like infoset and typed infoset amongst ourselves and have replaced that with the term XPath 2.0 data model which is unambiguous, formally defined and exactly what we have in mind when we think of concrete refinements of the infoset

  • URIs are important because they are the addresses of where you retrieve or send your XML messages.

  • For simple read-only retrieval of XML documents all you probably need is HTTP GET + your application specific XML. This resonates with me and is something I've often wondered about when I see folks attempt to inject SOAP in such scenarios.

  • For more sophisticated interactions between the entities SOAP and the rest of the WS-* stack is important.
I missed the rest of the talk but would have loved to hear Don expand on those points. Don demoed InfoPath, Word 2003 and SQLXML before I left. From the audience reactions and a conversations with folks afterwards it seems quite a number of folks were impressed by how XML savvy Microsoft products were. Sweet.


Official Position on RSS

In the past few months I've been contacted twice by reporters looking for quotes about Microsoft's official position on RSS. I assume they pick me because of my Building a Desktop News Aggregator article. Since I don't want to have to deal with reporters if I don't have to I'm posting a preemptive answer in case any other reporters feel the need to send inquiries my way.
I work on the team that develops the core XML technologies for Microsoft platforms. Since RSS is not a core XML technology but an application of XML it is not a technology myself or anyone on my team would be involved with in an official fashion. Inquiries about Microsoft and RSS are better directed to teams that produce tools or websites that consume or produce content not myself.
Hopefully this should also answer the questions for the people who think I work on RSS Bandit in some official fashion.


Comparing XML Elements

Harry Pierson has a post about comparing XML elements which confuses me. He states
An example of XML's wire format roots is the text-oriented idea of equivalence. In OOP, data has explicit values. In XML, the string representation of the data creates a need to ensure canonical representation for determining equivalence. Class / Element identity has the same issue. In OOP, an object is explicitly mapped to one object. In XML, the equivalent mapping (to element type) is done by a string matching - a mapping made more difficult by the tacked-on concept of namespaces and namespace prefixes.
I've read the above paragraph about 10 times and still can't make head or tails of it. All I can tell is that it seems to be claiming that you can't compare XML elements without resorting to string comparison. This is inherently false and I can think of different ways in which one can compare equivalence of XML elements either through languages like XPath & XSLT or directly from APIs like XPathNavigator and XmlElement that don't resort to string comparison. I wonder if Harry or someone who can better parse the above paragraph can give me an example of where one has to resort to string comparison to check if some XML passed to an application matches some criteria or is equivalent to some other XML?

OK, I just thought about it some more and I think I see what Harry is getting at. If I get arbitrary XML as input to my method and want to compare whether the XML fragment is equivalent to another XML fragment there isn't an easy way to do this without converting both in-memory representations to their string representations (if they aren't strings already) and doing a string comparison. Hmmmm...

Something to add to the TODO list.


RSS Bandit Updates

It seems the band of merry men have been coding up a storm since I've been gone. Torsten has screenshots of the latest RSS Bandit build. Besides a number of bug fixes the two most obvious changes are that the app is now a lot faster and you can now flag blog items in case you want to read them later, follow up with a comment or whatever. The "flag item" feature is a bit buggy but nothing I can't cleanup before the weekend is over. It looks like it is about time I got together another public release.

It looks like Michael Earls has been hard at work coming up with an XHTML editor pane which we can then use as part of the blog posting front end for RSS Bandit. So not only will RSS Bandit enable people to post directly to their blogs using stuff like the Blogger API and the MetaWeblog API but it will ensure that their posts are well-formed XHTML.

Unnhhh... Na Na Na Na



I finally posted my EXSLT implementation to MSDN in the article EXSLT: Enhancing the power of XSLT. What I like about using my EXSLT implementation in the .NET Framework is that you get most of the cool functions folks will get in XSLT 2.0 without having to bite the strong typing bullet.

Even better is the fact that since my date/time support utilizes the .NET Framework's DateTime class I can support over a dozen date/time formats while XSLT 2.0 can only support the ISO 8601 format since that is what the xs:datetime type uses.


Get yourself a News Aggregator and subscribe to my RSSfeed

Disclaimer: The above comments do not represent the thoughts, intentions, plans or strategies of my employer. They are solely my opinion.