July 2006 Archives
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(); xslt.Load("XSLTFile1.xslt"); 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); w.Close();
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.