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

June 7, 2007

Next Visual Studio XML Tools

Microsoft XML Team posted a series of screencasts unveiling some new features in Visual Studio Orcas 2008. Short ones, but to the point, without blablahblah. I particularly like XML Editor ability to generate stub XML document from XML schema in just one tab click. Oh, and XSLT debugging is getting ...

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

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 14, 2007

XML Inclusions reversal or transclusions strike back

Kzu, being also one of the Mvp.Xml project users has this wild feature request. He wants to reverse XInclude resolving back. The scenario is simple: you load XML document A.xml containing XML Inclusions for B.xml and C.xml, XInclude processor resolves XML Inclusions, you get a combined document, edit it and then you save ...

February 13, 2007

XForms.org launched

Kurt Cagle launched XForms.org - The XForms Community Forum as well as XForms.org News Portal and XForms_Dev mailing list. Welcome to the new XForms.org Community Web Portal, a central clearinghouse for articles and resources on XForms based technologies. This site is intended as one gateway into the XForms community (the other ...

February 11, 2007

OpenXmlWriter - open source OpenXml text editor

openxml.biz announced the availability of the OpenXML Writer - open source text editor for creating OpenXML WordprocessingML files (.docx). Supported features include "text formatting options like bold, italic, underline, font color, font name , font size,  paragraph justification and text indentation.  Basic editing functions like cutting, copying,  pasting and spell ...

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

Why XML

Everybody who speaks English can communicate with anybody else who also happens to speak English. You can talk, you can mail, you can read books written in English by others. Sure you can invent your own language, no big deal. You can even make somebody learn it and then ...

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 27, 2006

The contest winners

And the winners are Dave Pawson and Leon Bambrick. Both of them are getting Visual Studio 2005 Team Suite with 1 year MSDN Premium Subscription. Congrats guys! I hope it will help with your work and so benefit the community. Sorry to the rest - I only have 2 cards ...

December 19, 2006

Using ms:string-compare() and the rest MS extension functions in XPath-only context

XslCompiledTransform implements the following useful MSXML extension functions. But what if you need to use them in XPath-only context - when evaluating XPath queries using XPathNavigator? ...

December 12, 2006

HtmlAgilityPack - DOM and XPath over HTML

I saw today Josh Christie post about "Better HTML parsing and validation with HtmlAgilityPack". HtmlAgilityPack is an open source project on CodePlex.  It provides standard DOM APIs and XPath navigation -- even when the HTML is not well-formed! Well, DOM and XPath over malformed HTML isn't new idea. I've been using ...

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 6, 2006

The Coolest XML Project Contest

I completely forgot that I still have one Visual Studio 2005 Team Suite with MSDN Premium Subscription gift card to give away. And it expires 12/31! Oh boy, what do I do now??? So for the next 2 weeks I'll be holding the "The Coolest XML Project Contest". ...

Java 6 gets pull XML API

Better late than never - forthcoming Java 6 (currently Release Candidate) will include StAX, pull based streaming XML API.  .NET has pull based XML parser (XmlReader) from the very beginning and Microsoft was arguing .NET's XmlReader is better than SAX since at least 2002. No, I'm not saying Java catches .NET up ...

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 28, 2006

Speaking of RELAX NG...

ISO published RELAX NG standard (also "Compact Syntax") for free at the "Freely Available Standards" page. Hmmm, since when ISO provides free standard downloads? Also:  Schematron, NVDL and more. [Via Rick Jelliffe] ...

XProc?

I've been reading about XProc, new XML Pipeline language proposed by W3C. Used to control and organize the flow of documents, the XProc language standardizes interactions, inputs and outputs for transformations for the large group of specifications such as XSLT, XML Schema, XInclude and Canonical XML that operate on and ...

November 24, 2006

XML Notepad 2006 goes 2007

Just couple of months after XML Notepad 2006 release Microsoft ships another version,  now called XML Notepad 2007. They even went and edited the article "XML Notepad 2006 Design" to be "XML Notepad 2007 Design". Cool. XML Notepad 2006 was released on the 1st September 2006, and 2 months later it had 175,000 ...

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

November 5, 2006

XPath, apostrophes and quotes

When working with XPath be it in XSLT or C# or Javascript, apostrophes and quotes in string literals is the most annoying thing that drives people crazy. Classical example is selections like "foo[bar="Tom's BBQ"]. This one actually can be written correctly as source.selectNodes("foo[bar=\"Tom's BBQ\"]"), but what if your string is ...

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 13, 2006

.NET XmlReader API flaw

.NET's XmlReader is a great XML parser, but it has one big flaw in its API: XmlReader doesn't expose attribute types. XML actually defines 8 attribute types: CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS. Yes, it's DTD, which apparently Microsoft considers to be dead,  but ID, IDREF, IDREFS types ...

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

October 3, 2006

Joe Fawcett is blogging

Joe Fawcett, XML expert and my fellow XML MVP  has started a blog. Highly recommended. Subscribed. ...

August 22, 2006

Extreme Markup Languages 2006 Proceedings Online

This is just a paradise for XML geeks: Extreme Markup Languages 2006 Conference Proceedings Online. Happy reading: Blazevic, Mario. "Streaming component combinators." In Proceedings of Extreme Markup Languages 2006. Brown, Alex. "Frozen streams: an experimental time- and space-efficient implementation for in-memory representation of XML documents using Java." In Proceedings of ...

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