May 11, 2008

IronXSLT v0.3 released

Here is a small quick release. IronXSLT v0.3. New in this version: IronXSLT installer turns on dynamic XSLT Intellisense   Improved compatibility with Visual Studio 2008 ...

May 3, 2008

Hidden Undocumented Feature of Visual Studio 2008 - Dynamic XSLT Intellisense

A very little known fact is that Visual Studio 2008 does support real XSLT intellisense - not a static XSLT schema-based one, but real dynamic intellisense enabling autocompletion of template names, modes, parameter/variable names, attribute set names, namespace prefixes etc. For some obscure reason it is off by default and ...

March 27, 2008

Generating HTML excerpts

Here is another interesting problem: how do you generate HTML excerpts preserving HTML structure and style? Say you have long XHTML text: <b>This is a <span style="color: #888">very long</span> text.</b> In browser it looks like this: This is a very long text. The text is 25 characters long. Now you ...

March 21, 2008

Generating Java using XSLT

We are working on yet another language migration tool and faced once again Java source code generation problem. Unfortunately Java doesn't have anything similar to .NET's CodeDOM, so we had to build own own Java generator. This time our development platform is XSLT 2.0. Yes, we are converting COOL:Gen (obscure ...

March 6, 2008

Sergey Dubinets is blogging

Sergey Dubinets, the guy behind Microsoft XSLT engine and tools is blogging. Subscribed. Highly recommended. More XSLT bloggers from Microsoft: Dimitre Novatchev, XSLT: Riding the challenge Anton Lapounov: XML XSLT and Beyond ...

February 20, 2008

Obfuscating XSLT

Inspired by ioccc.org, just for fun, really. Can you figure out what this stylesheet outputs (without running it of course)? <!DOCTYPE p [ <!ENTITY _0_ 'string'> <!ENTITY _0-0_ 'sub&_0_;'> ]> <p x:version="1.0" xmlns:x="http://www.w3.org/1999/XSL/Transform"> <x:variable name="_" select="document('')"/> <x:variable name="_-_" select="number(not(_-_=_-_=_-_=_-_))"/> <x:value-of select="concat( &_0-0_;(namespace-uri($_/*/*[$_-_]), $_-_, $_-_), &_0-0_;(name($_/*/*[$_-_]), &_0_;-length(*>*)*2, $_-_), &_0-0_;(@_>_-, &_0_;-length(******* div ...

February 11, 2008

Microsoft XSLT Profiler

Microsoft XML Tools team has released XSLT profiler addin for Visual Studio 2008. I've heard about this tool and even did a little testing long time ago (apparently it's very hard to release anything in Microsoft). First thing you need to know about Microsoft XSLT profiler - it requires Visual ...

February 8, 2008

New XSLT stylesheet template in Visual Studio 2008 (again)

When you create new XSLT stylesheet in Visual Studio via project (Add/New Item) or globally (File/New/File aka Ctrl+N), you start with template content. This template is changing in every new Visual Studio version, probably because every new generation of developers working on XSLT tools in Visual Studio have different vision ...

January 28, 2008

Testing XSLT

State of the art of XSLT testing in a simple succinct format by Tony Graham. Creating a working stylesheet may seem like an end in itself, but once it’s written you may want it to run faster or you may not be sure that the output is correct (And if ...

November 8, 2007

XSLT and XSS attacks

I noticed Robert Robbins was writing about XSS attacks using XSLT: It is possible to extend the power of XSLT using JavaScript embedded into the XSL file. Therefore any web application that allows the user to upload their own XSL file will be vulnerable to Cross Site Scripting attacks. Well, that's ...

October 30, 2007

IronXSLT v0.2 released

Better later than never. I uploaded IronXSLT 0.2 release. New in this version: IronXSLT should now run without Visual Studio 2008 SDK A notion of a Startup stylesheet in XSLT Library project "Debug" page in XSLT Library project properties, which has Startup stylesheet dropdown list "Set as StartUp Stylesheet ...

August 24, 2007

nxslt3.exe/NxsltTask v3.0 - now running compiled XSLT stylesheets

Here goes nxslt3.exe/NxsltTask v3.0. It's nxslt tool for .Net 3.5. It can do everything nxslt2/NxsltTask v2.3 can plus the ability to run compiled XSLT stylesheets. Now short documentation about running compiled XSLT stylesheets. Let's say you have a stylesheet called mytransform.xsl. First you compile it using nxsltc: nxsltc mytransform.xsl /out:mytransform.dll ...

August 20, 2007

One more quick nxsltc update

I updated nxsltc - XSLT compiler for .NET 3.5 tool one more time. I added /version:<x.x.x.x> and /keyfile:<file> options. Former is used to specify resulting DLL version and latter - to sign it with a strong name. nxsltc.exe catalog2html.xslt /version:2.3.4.5 /keyfile:d:\keys\test.snk The usage now looks like this: D:\>nxsltc.exe ...

August 19, 2007

nXSLTC - XSLT Compiler for .NET 3.5 gets updated for Visual Studio 2008 Beta2

I also updated nxsltc.exe (well, just rebuilt it using Visual Studio 2008 Beta2). nXSLTC is an experimental XSLT to MSIL compiler for the forthcoming .NET 3.5. nXSLTC compiles one or more XSLT stylesheets into DLL. Compiled stylesheets then can be used for transforming XML documents using XslCompiledTransform class. Download nXSLTC ...

nxslt2.exe/NxsltTask v2.3 released

What's the probability of having two car accidents in one month? It must be high enough. Just a month after the first one some asshole hit me and run away. I wonder if it's a bad luck or actually a good luck? Sure, my own car is totaled and a company car ...

July 16, 2007

Reminder: XslCompiledTransform natively supports exsl:node-set()

It's known that .NET XSLT engine - XslCompiledTransform natively supports two EXSLT extension functions - exsl:node-set() and exsl:object-type(). Not that it's widely known (msdn still says nothing about it), but lots of people are using this handy feature. The main benefit is that using EXSLT's version of node-set() function allows complex XSLT stylesheets ...

July 12, 2007

Producing XHTML using XSLT in .NET

Producing XHTML using XSLT 1.0 processor is tough (no wonder - XSLT 1.0 is so old - it was published even before XHTML 1.0). While XHTML is just XML, XHTML spec defines a set of very specific formatting rules called "HTML Compatibility Guidelines". The goal is to facilitate rendering of XHTML ...

July 10, 2007

Saxon, NET and XInclude

Saxon, famous XSLT 2.0 and XQuery processor, supports XInclude since version 8.9. But in Java version only! When I first heard about it I thought "I have good XInclude implementation for .NET in Mvp.Xml library, let's check out if Saxon on .NET works with XInclude.NET". I did some testing only to ...

July 3, 2007

Mvp.Xml Library version 2.3 released

I released version 2.3 of the Mvp.Xml Library, which is part of the Mvp.Xml Project developed by Microsoft MVPs in XML technologies worldwide. It is aimed at supplementing .NET framework XML processing functionality. Mvp.Xml Library provides .NET implementations of the EXSLT, XML Base, XInclude, XPointer as well as a unique ...

May 30, 2007

Smart trick - exslt:node-set() in Internet Explorer

I found this gem in David Carlisle's blog. Smart Javascript trick allows to mask msxsl:node-set() extension function as exsl:node-set() and so you can easily write crossbrowser XSLT stylesheets using exsl:node-set() functionality. Opera 9, Internet Explorer 6-7 and Firefox 3 are covered, but sadly Firefox 2 is out of the game. Julian ...

May 27, 2007

IronXSLT: Changing the Way You Work with XSLT in Visual Studio

Yes, I'm trying to change the way you work with XSLT in Microsoft Visual Studio. It must be a pleasure to develop and rocket fast at runtime. Yes, Visual Studio already supports editing, running and even debugging XSLT, but it's still a painfully limited support. So I'm started building IronXSLT ...

May 15, 2007

Compiled XSLT decompiler?

I was reading Scott's post on Reflector Addins and had this idea... Now (well, not now but in the next .NET version - Orcas) that XSLT can be compiled into dll, it must be time to think about XSLT decompiler (and appropriate Reflector addin of course). I believe that must be ...

May 9, 2007

Couple teasers on my next toy

To be continued... ...

April 25, 2007

David Carlisle and Jeni Tennison are blogging

David Carlisle and Jeni Tennison are blogging. Skies are falling. Enough said. Subscribed. ...

April 18, 2007

HOW TO: Pipeline XSLT Transformations in .NET 2.0 Applications

I mean pre-XProc XSLT pipeline - just when you need to transform an XML document by a sequence of XSLT stylesheets - output from the first transformation goes as input to the second one and so on. This is useful technique helping dramatically simplify your complex multi-stage XSLT stylesheets. Unfortunately there is no ...

April 5, 2007

nXSLTC - an experimental XSLT compiler for .NET 3.5

So here is nXSLTC.exe v1.0b - an experimental XSLT compiler for .NET 3.5 (Visual Studio "Orcas"). Get it here (free open-source). I probably shouldn't be building this tool, but I have my reasons. Why not? As a matter of fact, Mike Champion has announced back in February that Microsoft ...

February 6, 2007

Generating XML entity references (&foo;) with XSLT: XSLT 2.0 to the rescue

Here is a problem: XSLT 1.0 sucks on generating XML character or entity references. I mean getting &foo; out of XSLT 1.0 is hard. The only ugly solution is disable-output-escaping hack, but it's a) optional, b)doesn't work in all scenarios (only when XSLT engine controls output serialization into bytes and c) works only on ...

February 4, 2007

On embedding XSLT stylesheets into assemblies

I was writing about loading XSLT stylesheets embedded into assemblies (dll or exe) recently and Richard Quinn asked this very legitimate question: But why oh why would anyone embed their XSLT in the assembly? The point is to separate design from logic. Even if the xslt does a non-presentational transform ...

January 30, 2007

Microsoft to implement XSLT 2.0

Now it's official, from the Microsoft XML Team: Our users have made it very clear that they want an XSLT 2.0 implementation once the Recommendation is complete.   A team of XSLT experts is now in place to do this, the same people who have been working on  the XSLT enhancements ...

January 23, 2007

XQuery, XSLT 2 and XPath 2 go Recommendation

This was meant to be one big huge milestone. If only it was done 3 years ago. I hope it's not too late though: XQuery, XSLT 2 and XPath 2 Are W3C Recommendations 2007-01-22: The World Wide Web Consortium has published eight new standards in the XML family for data mining, document transformation ...

December 10, 2006

nxslt v2.1 released - now including NAnt/MSBuild task

I just uploaded nxslt v2.1 release. In addition to the nxslt.exe command line tool it now also includes nxslt task implementation for NAnt and MSBuild. ...

December 5, 2006

NAnt doesn't suck, but MSBuild does it big time

I was building NAnt and MSBuild tasks for the nxslt tool last two days and the bottom line of my experience is "previously I thought NAnt sucks, but now I know NAnt is brilliant and it's MSBuild who sucks really big way". My complaints about NAnt were that NAnt being .NET ...

November 23, 2006

Muenchian grouping perf in .NET 2.0 (XslCompiledTransform)

Back in 2005 I was writing about speeding up Muenchian grouping in .NET 1.X. I was comparing three variants of the Muenchian grouping (using generate-id(), count() and set:distinct()). The conclusion was that XslTransform class in .NET 1.X really sucks when grouping using generate-id(), performs better with count() and the best ...

November 19, 2006

Reporting XSLT compilation errors in .NET

Reporting errors in XSLT stylesheets is a task that almost nobody gets done right. Including me - error reporting in nxslt sucks in a big way. Probably that's because I'm just lazy bastard. But also lets face it - XslCompiledTransform API doesn't help here. Whenever there are XSLT loading (compilation) errors ...

November 16, 2006

How to get line number for a node in XSLT

It's surprisingly easy in .NET 2.0. Obviously it can't be done with pure XSLT, but an extension function returning line number for a node takes literally two lines. The trick is to use XPathDocument, not XmlDocument to store source XML to be transformed. The key is IXmlLineInfo interface. Every XPathNavigator over XPathDocument ...

October 15, 2006

xsl.info xpath.info domains

I still own xsl.info and xpath.info domain names and still have no time to build anything around there. If anybody have any ideas about any community driven projects - let me know, I'm willing to donate domain name and may be participate. And if anybody want to buy these domain names ...

October 12, 2006

XSLT scripting (msxsl:script) in .NET - pure fast evil

Another coding horror story was reported in the microsoft.public.dotnet.xml newsgroup: I've been experiencing OutOfMemory errors on our prodution webserver for a few weeks now. I've finally managed to isolate (I think) the problem to our use of c# script blocks in our xsl files. While debugging I discovered that the app ...

August 22, 2006

FXSL 2.0

Dimitre Novatchev has uploaded another FXSL 2.0 release. FXSL is the best ever XSLT library: The FXSL functional programming library for XSLT provides XSLT programmers with a powerful reusable set of functions and a way to implement higher-order functions and use functions as first class objects in XSLT . Now ...

August 16, 2006

Dimitre Novatchev is blogging

Congratulations to all XSLT geeks - Dimitre Novatchev, XSLT extraordinaire is blogging! Whoha! Subscribed. ...

July 26, 2006

Anton Lapounov is blogging

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. ...

July 11, 2006

How to validate XSLT output in .NET 2.0

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 ...

June 13, 2006

XSLT2/XPath2/XQuery1 fresh CRs

W3C has released fresh versions of the Candidate Recommendations of XML Query 1.0, XSLT 2.0, XPath 2.0 and supporting documents. No big deal changes - xdt:* types has been moved to xs:* namespace (damn XML Schema). See new XQuery1/XPath2 type system below. Looks like XSLT2/XPath2/XQuery1 are moving fast toward Proposed ...

May 11, 2006

Saxon.NET and System.Xml.Xsl

I really enjoy seeing Michael Kay talking about working with XML in .NET. That makes me feel I might be not a freak after all. ...

April 25, 2006

Martin Szugat's article about eXml Web server control

Martin Szugat, .NET and XML expert from Germany has published an article about using my eXml Web server control in ASP.NET 2.0. The article was published in the German dot.net magazin and now it also went online in the German MSDN: "Von der Quelle zum Kunden. Anzeige von XML-Daten auf ...

April 24, 2006

How to check if XslCompiledTransform instance has already loaded a stylesheet

XslCompiledTransform provides amazing transformation performance, but obviously not without a price. As with any compiling system the price is slower and quite resource consuming compilation stage. That's why it's very important to cache loaded XslCompiledTransform instance to avoid paying compilation price over again. One question that comes sometimes while implementing ...

April 9, 2006

XSLT 2.0 in .NET Survey Winner

Well, "XSLT 2.0 in .NET" survey at the XML Lab site has ended back in January and I forgot to select a winner. Ooops. Let's finish this now. I obviously made a mistake requiring user registration for voting, but then I needed some way to identify a winner... Anyway, 40 ...

March 2, 2006

eXml updated

Ok, I'm back. I have updated eXml Web Server Control, which uses XslCompiledTransform, supports 70+ EXSLT functions, XInclude, friendly XML rendering, <?xml-stylesheet?>, embedded stylesheets etc.Martin Szugat found some bugs and kindly provided patches, thanks Martin! Additionally I implemented one small but useful feature users kept asking for - cache dependencies ...

January 25, 2006

XSLT 2.0 and .NET unofficial survey ends January 31

"XSLT 2.0 in .NET" survey at the XML Lab site ends in a week.Vote now and get a chance to win the "XSLT 2.0" book by Mike Kay!When the survey ends one lucky survey taker from whatever part of the world choosen randomly will get the book. Note: you ...

January 24, 2006

exsl:object-type() XSLT extension function in .NET 2.0

Now that XslCompiledTransform in .NET 2.0 supports exsl:object-type() extension function I think a little intro is needed as this is really new function for Microsoft-oriented XSLT developers. ...

January 15, 2006

Detecting version of Microsoft XSLT engine from within XSLT

Sometimes it's useful to detect which XSLT engine your XSLT stylersheet is being executed by, e.g. to shortcut processing using an engine-specific extension function or to workaround a bug in particlular engine. Now that Microsoft alone ships 3 different XSLT engines - MSXML3/MSXML4/MSXML5/MSXML6, XslTransform and XslCompiledTransform, detecting XSLT engine from ...

January 11, 2006

Microsoft and EXSLT - secret breakthrough

There are two new killer but undocumented features in Microsoft .NET 2.0 pertaining to EXSLT. Anybody like me regularly digging in System.Xml assembly probably knows it, but general audience is still unaware. So I want to share these secrets. ...

January 10, 2006

Quiz of XSLT 1.0 oddities by James Fuller

You say you know XSLT well? Try answer this quiz of XSLT 1.0 oddities by James Fuller. ...

January 9, 2006

WordML2HTML with support for images stylesheet updated

Almost 2 years ago I published a post "Transforming WordML to HTML: Support for Images" showing how to hack Microsoft WordML2HTML stylesheet to support images. People kept telling me it doesn't support some weird image formats or header images. Moreover I realized it has a bug and didn't work with ...

December 20, 2005

The Raise of XSLT Compilation

Slowly, gradually and with not much loud buzz both modern managed platforms - Java and .NET have switched to compiling XSLT implementations by default. First Java 5.0 made compiling Apache XSLTC processor a default transformer in JAXP 1.3 (instead of interpreting Apache XALAN). Then Microsoft released .NET 2.0 with new ...

December 13, 2005

"Schema-Aware