July 2006 Archives

Anton Lapounov is blogging

| No Comments | No TrackBacks | , ,

Anton Lapounov is blogging! He's one of the brilliant guys responsible for XSLT in the Microsoft XML Team. If you are subscribed to my blog, you want to subscibe to "Anton Lapounov: XML XSLT and Beyond" blog too.

Summer colors

| No Comments | No TrackBacks |

© Alenka Tkachenko

Just in case if somebody have missed this cool new tool - check out DonXML's into into XPathmania. It's free open-source Visual Studio add-in for XPath development. I just can't live without it already. Very cool stuff, part of our Mvp.Xml project.

MSXML 6.0 SDK finally released

| 2 Comments | No TrackBacks |

Microsoft finally released MSXML6 (aka Microsoft Core XML Services) SDK. I've been told it was expected back in December. Anyway, it's ready. Now it would be nice if Microsoft updated MSXSL utility to support MSXML6 (I know it was also ready back in December too).

Poor little Lebanon

| 21 Comments | No TrackBacks |

I've been reading some Lebanese blogs trying to understand what people from the other side of the bleeding border think. And I realized how weird country Lebanon is. Where in the world a government would strongly refuse to control a half of its own country? It's like the whole world is asking the Lebanese government - come on, you guys are the Lebanon government, please, please, take control over south Lebanon, that's your land. No, no, no, never ever said the freaking government - there is a bunch of bad guys over there, terrorists you know they can bite so we better don't. Oooooookay. Now they badly surprised it hurts to host bad guys, hmmm.

Yes, I found out that almost every single Lebanese blog I spotted says something like "That f#cking Hezbollah terrorists! That's all their fault! Hezbollah != Lebanon, we have nothing to do with this war, we are just suffering here". That even made sense for a moment, but then - who are those bad Hezbollah guys? As it turned out they are not martians not even iranians, but ordinar lebanese people, moreover Hezbollah (being widely recognized as a terrorists group) is representing the largest Lebanon's religious group, it's a recognized political party holding 23 seats in the 128-member Lebanese Parliament and participating in Lebanese government. So, again - "Hezbollah != Lebanon"? Oh come on, that's ridiculous. Hezbollah == Lebanon, face it.

I think in fact there is no one single country of Lebanon. I have no idea how such different groups can live in the same state. Those normal lebanese people whose blogs I read - you should do something about this, guys. Otherwise don't be surprised to be paying painfully for what your evil brothers do.

How would you validate XSLT output on the fly without caching transformation result as a whole? That's easy - just use MvpXslTransform class that adds to the XslCompiledTransform class ability to transform into XmlReader and wrap that reader witth a validating reader. As a result - streaming validation, no memory hogging and ability to abort transformation at first validation error. Simple sample below.

XPathDocument doc = 
    new XPathDocument("source.xml");
MvpXslTransform xslt = new MvpXslTransform();
XmlReader resultReader = 
    xslt.Transform(new XmlInput(doc), null);
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
settings.Schemas.Add("", "orders.xsd");
XmlReader validatingReader = 
    XmlReader.Create(resultReader, settings);
XmlWriter w = XmlWriter.Create(Console.Out);
w.WriteNode(validatingReader, false);

You can get MvpXslTransform class with Mvp.Xml library v2.0 at the Mvp.Xml project site.

ScriptAculoUs autocomplete web control from SimoneB is a nice lightweight easy to use ASP.NET autocomplete textbox control with many virtues. The only problem I had with it was that dropdown autocomplete list has no scrolling and so long autocomplete lists look ugly. Happily it comes with sources so I hacked it to add scrolling, here is the solution in case somebody needs it.

  1. In Suggestion.cs add a CSS class to the UL tag generated for an autocomplete list:
    StringBuilder returnValue = new StringBuilder("<ul class=\"autocomplete\">");
  2. In a stylesheet constrain autocomplete list height and enable scrolling on overflow:
        height: 10em;
  3. In controls.js, modify "render" function to make autocomplete list automatically scrolling so a selected item is always visible:
      render: function() {
        if(this.entryCount > 0) {
          for (var i = 0; i < this.entryCount; i++) {
            this.index==i ? 
              Element.addClassName(this.getEntry(i),"selected") : 
            if (this.index == i) {
              var element = this.getEntry(i);
          if(this.hasFocus) { 
            this.active = true;
        } else {
          this.active = false;
That does it. Works fine in both IE and FF.