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

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

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

R.I.P. GotDotNet

Microsoft decided to shut down GotDotNet site by July 2007. The official announcement goes like this: Microsoft will be phasing out the GotDotNet site by July 2007. Microsoft will phase out all GotDotNet functionality by July 2007. We will phase out features according to the schedule below. During the ...

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

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

MSBuild custom task with a subtree?

I'm missing something obvious and spent already about two hours on that simple problem. I hope somebody profficient in MSBuild drops me a line. How do I build MSBuild custom task that has XML subtree? Here is my NAnt task:<nxslt in="books.xml" style="books.xsl" out="out/catalog.html"> <parameters> <parameter name="param1" namespaceuri="" value="val1"/> </parameters> </nxslt> How ...

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

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

May 31, 2006

On creating custom XmlReaders/XmlWriters in .NET 2.0, Part 2

This is second part of the post. Find first part here. So what is a better way of creating custom XmlReader/XmlWriter in .NET 2.0? Here is the idea - have an utility wrapper class, which wraps XmlReader/XmlWriter and does nothing else. Then derive from this class and override methods you ...

May 30, 2006

On creating custom XmlReaders/XmlWriters in .NET 2.0

When developing custom XmlReader or XmlWriter in .NET 2.0 there is at least three options: implement XmlReader/XmlWriter extend one of concrete XmlReader/XmlWriter implementations and override only methods you need implement XmlReader/XmlWriter by wrapping one of concrete XmlReader/XmlWriter implementations and overriding only methods you need ...

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

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 15, 2005

XInclude and Mvp.Xml Library in Microsft products

By the way, this is sort of a milestone for the Mvp.Xml project - Microsoft has released Guidance Automation Toolkit (GAT) and Guidance Automation Extensions (GAX) for Visual Studio 2005 which uses and includes recently released Mvp.Xml library v2.0, particularly our XInclude implementation. This is the first Microsoft product using ...

December 12, 2005

On making noise about XSLT 2.0 and Microsoft

Dare thinks I'm making fruitless noise asking people if they need XSLT 2.0: I'm not sure how an informal survey in a blog would convince Microsoft one way or the other about implementing a technology. A business case to convince a product team to do something usually involves showing them ...

Processing XML in .NET: Antipatterns

I run into this article "Harnessing the BackPack API" by Michael K. Campbell in the new and very cool "XML 4 Fun" column at MSDN. The article is otherwise brilliant and really fun, but XML processing code samples are not so good. It's actually a great collection of XML processing ...

December 11, 2005

XSLT 2.0 and Microsoft Unofficial Survey

Moving along business cases Microsoft seeks to implement XSLT 2.0 I'm trying to gather some opinion statistics amongs developers working with XML and XSLT. So I'm holding this survey at the XML Lab site: Would you like to have XSLT 2.0 implementation in the .NET Framework? The possible answers are ...

December 9, 2005

eXml - extended ASP.NET XML Web server control v1.0 released

I'm glad to announce first release of the eXml - extended ASP.NET Xml Web Server Control. eXml is a free open-source ASP.NET 2.0 Web server control extending and improving standard ASP.NET XML Web server control. eXml Web server control uses new .NET 2.0 XSLT processor - XslCompiledTransform class to perform ...

December 5, 2005

nxslt v2.0 released

nxslt v2.0 (aka nxslt2) is available for download. This is first nxslt release for .NET 2.0. nxslt is a free feature-rich command line utility that allows to perform XSL Transformations (XSLT) using .NET Framework 2.0 XSLT implementation - System.Xml.Xsl.XslCompiledTransform class. nxslt is compatible with Microsoft's MSXSL.EXE tool and additionally supports ...

November 29, 2005

Mvp.Xml library v2.0 released

I'm glad to announce release 2.0 of the Mvp.Xml library. This is first Mvp.Xml release for .NET 2.0. Download it here. Mvp.Xml project is developed by Microsoft MVPs in XML technologies and XML Web Services worldwide. It is aimed at supplementing .NET framework XML processing functionality available through the System.Xml ...

November 6, 2005

XLinq news

After initial announcement XLinq hubbub seems to be more and more quiet - users are busy moving to .NET 2.0 and Microsoft is working on the next preview version. Anyway, there are some news: Microsoft released "C# LINQ Tech Preview Update for Visual Studio 2005 RTM Release": This is an ...

November 1, 2005

XslCompiledTransform and XmlReader output problem solved

There is a known problem with new XSLT processor in just released Microsoft .NET 2.0 - XslCompiledTransform class doesn't support pull mode XSLT - outputting XSLT result in XmlReader form as obsolete XslTransform class did. I'm happy to announce that the problem is solved now. Sergey Dubinets from the Microsoft ...

October 27, 2005

nxslt 1.6.4 released

Another minor nxslt release is available - v1.6.4. This version adds support for the "extension-element-prefixes" attribute and fixes a glitch in transformation timings reporting. What's the problem with "extension-element-prefixes" attribute? When using <exsl:document> extension element to produce multiple outputs some EXSLT-aware XSLT tools (like 4XSLT) rightly require "exsl" prefix to ...

October 10, 2005

ValidationType.Auto is obsolete, what do I do?

In .NET 2.0 ValidationType.Auto value is made obsolete. What's worse - it doesn't work for XmlReaders created via XmlReader.Create() factory method. But how do you validate against either DTD and/or schema, i.e. against DTD if document has a DOCTYPE and/or schema if any is applicable? The answer is: you can ...

October 9, 2005

"Migrating to XslCompiledTransform" article

Microsoft XML Team has published an article "Migrating to XslCompiledTransform" by my pals Sergey Dubinets and Anton Lapunov. It explains how to migrate to the new XSLT 1.0 processor in .NET 2.0 - XslCompiledTransform class. XslCompiledTransform is a revolutionary XSLT processor - it's gonna be the first truly compiled mainstream ...

October 6, 2005

nxslt 1.6.1 released - bug fix only

nxslt 1.6.1 is available for download at the xmllab.net. This is bug fix only release. Marc Stober reported that when running into XInclude error he got MissingManifestResourceException. Apparently XInclude string resources weren't compiled into the nxslt.exe. This release fixes this bug. Thanks for reporting, Marc! nxslt is free feature-rich command ...

September 28, 2005

Aftermatch thoughts on XLinq

I finally got some time (18 hours in a plane to Seattle :) to settle down my mind about XLinq. Erik Meijer's excellent article, which explains XLinq from functional programming point of view made me changing my mind on some issues I wrote earlier, some hands on experience and some ...

September 26, 2005

What XLinq misses

XLinq is at early stages, but what else would I like to see in XLinq? Here are my crazy wishes. Shortcuts. In C# I need book["title"] instead of book.Element("title"). last() and position() Literal XML just like in C-omega, not "kinda pseudo XML literals" like in VB9. Fine control over serialization ...

On XML expanded names in XLinq

Dave Remy writes about XName and expanded names in XLinq and he wants feedback. Here we go. ...

XLinq Bitter Words, Part III - Weird things

Nodes in XLinq overload ToString() method to provide pretty-printed outer XML representation. At the same time nodes contain (familiar for MSXML users and new for .NET users) readonly Xml property, which returns raw (not pretty-printed) outer XML representation. At also at the same time casting element to a string returns ...

XLinq Bitter Words, Part II - Heterogenuos XML Tree

In XLinq XML Tree is exposed in a heterogenos way, that is nodes in a tree don't belong to a common type. Traditionally XML tree models are homogeneous, e.g. in DOM every node belongs to a specific kind of XmlNode class. But in XLinq attributes and text nodes aren't actually ...

September 25, 2005

"XLinq: XML Programming Refactored (The Return Of The Monoids)" Paper by Erik Meijer and Brian Beckman

Erik Meijer: XLinq: XML Programming Refactored (The Return Of The Monoids) I just posted my XML 2005 submission about XLinq on my homepage. It describes the XLinq API in somewhat detail, and informally explains the relationship between LINQ and monads. That's really good one. [Via Lambda the Ultimate] ...

September 23, 2005

XLinq Bitter Words, Part I - XML functional construction

XLinq is new and hot technology everybody seems to be happy with. I'm going to post a different review series - not what I like, but what I dislike and want to be fixed in XLinq. Sorry in advance for bitter words, but it's better when your friend says them ...

September 22, 2005

XLinq.Net

Being excited about XLinq I couldn't stop myself from grabbing XLinq.NET domain name. I'm going to try to build a community portal for the XLinq technology. The goal is basically to push XLinq by growing a community around it. There is definitely a need for Microsoft-independent easily accessible place where ...

September 13, 2005

C# 3.0 chat with C# team

That's an interesting chat: C# 3.0 Language Enhancements Description: Can't attend PDC but still want to talk to the C# team? This chat is your chance! Join the C# team to discuss the newly announced C# 3.0 features like extension methods, lambda expressions, type inference, anonymous types and the .NET ...

August 28, 2005

On XPathNavigator.SelectSingleNode again

I've seen some people talking and some leaving comments that newly introduced XPathNavigator.SelectSingleNode() method is actually a wrapper around XPathNavigator.Select and so it provides no performance benefits. This is both true and false. It's true that you won't get any performance boost from moving to XPathNavigator.SelectSingleNode() method, because it's really ...

August 24, 2005

Reading BinHex encoded data out of XmlDocument

It's surprisingly tricky to get BinHex encoded data out of XmlDocument tree in .NET 1.X. XmlConvert class, which apparently has to support such conversions has a method FromBinHexString(), but weird - it only public for .NET Compact Framework. It's internal for regular .NET Framework. It's obvious that lots of .NET ...

July 26, 2005

XML and .Net: fascinating future

If you thought that some smell of XML in C-omega was amazing, believe me that's nothing. Major XML and .NET integration stories are still ahead of us. Something big is cooking inside the house. Look at these news. ...

July 21, 2005

Mvp.Xml v1.1 released. Now including EXSLT.NET module

I've just finished moving EXSLT.NET code into the Mvp.Xml project infrastructure. Now on EXSLT.NET is a module of the Mvp.Xml library, its namespace is Mvp.Xml.Exslt, its license is CPL and its home page is http://mvp-xml.sourceforge.net/exslt. That's pretty much all changes. Go download Mvp.Xml library v1.1, now including EXSLT.NET module in ...

July 19, 2005

XPathReader v1.1 released

XPathReader v1.1 is available for download. XPathReader is originally developed inside Microsoft and then dropped out as open-source implementation of a pull-based XML parser that supports XPath queries while parsing the XML document. It's basically XmlReader that supports streaming subset of XPath 1.0. Read "The Best of Both Worlds: Combining ...

New in .NET 2.0: XPathNavigator finally has SelectSingleNode() method

In .NET 2.0 XPathNavigator finally has SelectSingleNode() method! MSXML and XmlDocument (XmlNode actually) have it forever and it's so widely used because it's soooo handy. Obviously despite its name, XPathNavigator.SelectSingleNode() returns not a node, but node equivalent in XPathNavigator's data model - XPathNavigator. And this method is even better than ...

July 18, 2005

nxslt 1.6 and nxslt2 Beta1 released

nxslt 1.6 and nxslt2 Beta1 are available for download. For those not familiar with nxslt: nxslt is free feature-rich .NET XSLT Command Line Utility. nxslt 1.6 is the next version for the .NET 1.X Frameworks. New features include optionality for source XML or stylesheet, pretty printing, ASCII only escaped output ...

July 12, 2005

Outputting HTML with XslCompiledTransform and XmlResolver

I was wrong in my last post. Here is how one can output HTML with XslCompiledTransform when XmlResolver needs to be passed to Transform() method. using (XmlReader src = XmlReader.Create("../../source.xml")) { XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load("../../style.xslt"); XmlWriter result = XmlWriter.Create(Console.Out, xslt.OutputSettings); xslt.Transform(src, null, result, new XmlUrlResolver()); } The key ...

July 11, 2005

XslCompiledTransform API bug (update - not a bug, my fault)

I'm porting nxslt utility to .NET 2.0 with XslCompiledTransform as XSLT processor and I just found out XslCompiledTransform API is really severe broken. I was writing before that the only Transform() method overload that accepts XmlResolver outputs to XmlWriter. So if you want to create HTML and to have some ...

July 10, 2005

Loading XPathDocument with XmlWriter

What I dislike in System.Xml v2.0 (and v1.X for that matter) is a poor support for push-based XML processing. Somehow it's all about pull - XmlReader, while push - XmlWriter seems to be a second class citizen. For instance one can't populate XML into XPathDocument or XSLT stylesheet into XslCompiledTransform ...

June 23, 2005

RE: ASP.NET 2.0 XmlDataSource's XPath doesn't support namespaces

Scott Hanselman: I'm working (again) on the XML Chapter to our upcoming book. The book is all about ASP.NET 2.0, but XML is such an important part of ASP.NET that this chapter gets bigger and bigger. I've been updating it from the original Beta 1 version this last few months ...

June 22, 2005

Alex Homer explains how to read and write XML in .NET 2.0

15seconds.com published a series of articles by Alex Homer on reading and writing XML in .NET Version 2.0: Reading and Writing XML in .NET Version 2.0 - Part 1 Reading and Writing XML in .NET Version 2.0 - Part 2 Excellent articles. Part 3 is expected too according to Alex's ...

June 14, 2005

EXSLT.NET to be integrated into the Mvp.Xml project

It's official now - we (XML MVPs) agreed and Dare (as EXSLT.NET project owner) has approved an integration of the EXSLT.NET project into the Mvp.Xml library. All EXSLT.NET project contributors may ask to be added as developers to the Mvp.Xml project. I will be moving code soon, as well as ...

June 12, 2005

Microsoft surveys on XSLT 2.0 support

Microsoft's XML Team is asking you: XSLT 2.0 - 1. Do we need to support XSLT 2.0 ? 2. What are the most useful features of XSLT 2.0 that you would like to see implemented? (like grouping , support for datetime etc) 3. Do you believe support for the entire ...

June 8, 2005

Microsoft XML Team strikes back on XML performance comparison in .NET and Java

Microsoft XML Team has posted a response "Comparing XML Performance" to the Sun XML Mark 1.0 benchmark and accompanying whitepaper from Sun XML Performance Team asserted that Java significantly outperforms .NET in XML processing performance. ...

May 31, 2005

Effective XML: Dumping XML content while reading it from a stream

A fellow MVP asked if there is a way to dump XML content while reading it from a stream without buffering the whole XML document. Here is a scenario - an XML document being read from a HttpWebResponse stream and needs to be passed as an XmlReader to an XmlSerializer ...

May 26, 2005

Altsoft released Xml2PDF formatting engine version 2.3, now supporting WordML

Altsoft N.V. has announced a relase of the Xml2PDF formatting engine version 2.3, now supporting WordML. Altsoft Xml2PDF is a .NET based formatting engine for converting various XML-based formats to PDF. It supports XSL-FO, SVG, XHTML, WordML and XML+XSLT as an input and generates PDF as an output. The prices ...

May 25, 2005

Mvp.Xml Project Statistics

SourceForge has fixed the stat system and now we can analyze Mvp.Xml project statistics. The numbers are good - 8-15K hits/mo and 700-800 downloads/mo, not bad for a 1.0 release. ...

May 2, 2005

Microsoft licensed Mvp.Xml library

On behalf of the Mvp.Xml project team our one and the only lawyer - XML MVP Daniel Cazzulino aka kzu has signed a license for Microsoft to use and distribute the Mvp.Xml library. That effectively means Microsoft can (and actually wants to) use and distribute XInclude.NET and the rest Mvp.Xml ...

April 3, 2005

XML Indexing Article went live

Part 1 of my "Indexing XML" article went live at the MSDN XML Dev Center. In this article I discuss various aspects of indexing standalone XML documents - XML IDs, XSLT Keys and introduce IndexingXPathNavigator class, part of the Mvp.Xml library, which enables lazy or eager indexing of any IXPathNavigable ...

March 10, 2005

How to speed up Muenchian grouping in .NET

Muenchian technique of grouping is de-facto standard way of grouping in XSLT 1.0. It uses keys and is usually very fast, efficient and scalable. There used to be some problems with using Muenchian grouping in .NET though, in particular the speed was in question. To put it another way ...

March 6, 2005

XmlTextReader video tutorial from Dan Wahlin

Second video installment in XML API fundamentals series from Dan Wahlin - this time on my favorite - XmlTextReader. Good way to grasp basics. ...

March 3, 2005

Indexing XML article, part 1 - done

I finally finished that article and sent it to the MSDN XML Dev Center. It's two-part article discussing various XML indexing aspects. In the first part I covered techniques for indexing standalone XML documents - XML IDs, XSLT Keys and IndexingXPathNavigator. The next part will be completely focused on XML ...

February 24, 2005

Dan Wahlin explains XmlDocument fundamentals (video)

Dan Wahlin starts online video series on using XML APIs in the .NET framework. Watch the first video segment devoted to XmlDocument class here. This video segment demonstrates some XmlDocument class fundamentals including how the Document Object Model (DOM) works, parsing RSS feeds, filtering with XPath, and editing XML. ...

February 22, 2005

On XmlBookmarkReader

Helena Kupkova, known before by FastXML (she claimed it's 5x faster than MSXML), now working for Microsoft on XmlReader and who's behind amazing "Microsoft XML Diff and Patch 1.0" tool, has published an article at MSDN XML Dev Center called "XML Reader with Bookmarks". ...

February 5, 2005

ANN: nxslt.exe (.NET XSLT Command Line Utility) version 1.5

I'm glad to announce version 1.5 of the nxslt.exe - .NET XSLT command line utility. ...

January 23, 2005

Mitigating XPath Injection Attacks in .NET

It's already 2005 and everybody's aware of SQL injection attacks nowadays. But it's silly to think that this kind of attack is only about SQL, right? SQL injection is just one particular case of a general code injection attack - when somebody too gullible allows user input to become a ...

January 20, 2005

Mvp.Xml library v1.0 released

On behalf of the Mvp.Xml Project's team I'm glad to announce release v1.0 of the Mvp.Xml library. ...

December 22, 2004

XQuery in .NET story isn't over yet

Btw, talking with .NET developers recently (XML geeks and non-geeks) about XQuery and XSLT support in .NET 2.0 I realized that shocking fact - about 80% of devs I was talking to still have no idea XQuery support in .NET 2.0 was cut. They were listening all the road to ...

Another Microsoft XML blogger

Another good news - Dave Remy, a Lead Program Manager on Core XML Technologies at Microsoft is blogging. Subscribed. ...

December 19, 2004

Would you like to see XSLT1.1 + EXSLT in .NET2?

Hey, I've got another idea. XQuery and XSLT2 are surely huge undertakings (we can truly thank W3C for that), but still there is plenty of plain poor .NET devs struggling with limitations of XSLT 1.0 and XPath 1.0. What if Microsoft implements XSLT 1.1 + EXSLT in .NET 2.0, would ...

In other .NET related XML news

Some XML news in no any order: Irwin Dolobowsky says we should expect very interesting articles at MSDN XML Dev Center, especially I'm looking forward to this one - "Helena Kupkova will show us how to create bookmarks in XML Streams with the ResetableXmlReader." Hmmm, sweet. AFAIR we've been discussing ...

Red pill for Michael Champion

Oh that big news - Michael Champion is now Program Manager for XML Standards in the Microsoft's XML WebData team. Wow, wow, wow - that's the only words I can say. Here is his intro on his new blog (hey, he is a Microsoft employee, so it's http://blogs.msdn.com/mikechampion, not http://weblogs.asp.net/mikechampion ...

December 16, 2004

What's wrong with XslTransform's API?

I wonder if is there is something inherently wrong with XslTransform's class API? I was stunned again today reading this post in microsoft.public.dotnet.xml newsgroup: I still don't see any way to create a XslTransform from a XmlDocument? That's not the first time I see it actually. The answer of course ...

On XmlPreprocess tool

That guy Loren Halvorson has relased XmlPreprocess tool for preprocessing XML files, e.g. config files in .NET. It allows to perform the following tricks: <configuration> <system.web> <!-- ifdef ${production} --> <!-- <compilation defaultLanguage="c#" debug="false"/> --> <!-- else --> <compilation defaultLanguage="c#" debug="true"/> <!-- endif --> </system.web> </configuration> As you can see ...

December 14, 2004

A letter from a dead house

I was doing some catch up reading feeds I'm subscribed and I found this one item that made me feeling some sort of bitter nostalgia. It's right on MSDN TV site, a new episode where Mark Fussel explains new XML features in upcoming .NET 2.0. The episode is dated December ...

November 22, 2004

Calling document("") in .NET

There was recently an interesting thread in the microsoft.public.dotnet.xml newsgroup on document("") function call in .NET. A guy was porting some app from using MSXML to .NET. Something didn't work... You know these common bitter (and usually completely lame) complaints: It is strange, this all works just fine using MSXML4 ...

November 17, 2004

Minor EXSLT.NET update

Just for the record: I updated EXSLT.NET to support for omit-xml-declaration attribute on the exsl:document element. If somebody desperately needs it, it's in the source repository already. ...

October 31, 2004

Cw (Comega) language compiler pereview (again?)

From the Microsoft Research: Comega is an experimental language which extends C# with new constructs for relational and semi-structured data access and asynchronous concurrency. Cw is an extension of C# in two areas: - A control flow extension for asynchronous wide-area concurrency (formerly known as Polyphonic C#). - A data ...

October 25, 2004

Implementing XML Base in .NET

XML Base is a tiny W3C Recommendation, just couple of pages. It facilitates defining base URIs for parts of XML documents via semantically predefined xml:base attribute (similar to that of HTML BASE element). It's XML Core spec, standing in one line with "Namespaces in XML" and XML InfoSet. Published back ...

October 24, 2004

Indenting attributes with XmlTextWriter

XmlTextWriter in .NET 1.X only supports indentation of the following node types: DocumentType, Element, Comment, ProcessingInstruction, and CDATA. No attributes. So how to get attributes indented anyway? If you can - wait .NET 2.0 with cool XmlWriterSettings.NewLineOnAttributes, otherwise - here is a hack how to get attributes indented with XmlTextWriter ...

Samples are templates

DonXML writes on viral coding examples in presentations on using XML in .NET: Joe Fawcett (fellow XML MVP) came across a great example (from the Microsoft.Public.Xml newsgroup) of one of my biggest pet peeves, "We (the community) are doing a very poor job teaching the average developer how to use ...

October 20, 2004

SAX for .NET 1.0 released

Karl Waclawek has announced the first production release of the SAX for .NET library - open source C#/.NET port of the SAX API. It contains API and Expat-based implementation. AElfred-based implementation is expected soon. ...

October 13, 2004

Upcoming Changes to System.Xml in .NET Framework 2.0 Beta 2

Dare writes about "Upcoming Changes to System.Xml in .NET Framework 2.0 Beta 2". In short: No XQuery (only in SQL Server 2005 aka Yukon) New - push model XML Schema valiadtor - XmlSchemaValidator. XPathDocument is reverted the XPathDocument to what it was in version 1.1 of the .NET Framework. XmlReader ...

October 12, 2004

How to collect namespaces used in a XML document

The question raised in the microsoft.public.dotnet.xml newsgroup today: "How to retrieve the namespace collection of all the document namespaces for which there is at least one element in the document". The purpose is a validation against different schemas. Well, the most effective way of doing it is during XML document ...

October 10, 2004

XML Schema determined ID, XPointer and .NET

While old gray XPath 1.0 supports only DTD-determined IDs, XPointer Framework also supports schema-determined IDs - an element in XML document can be identified by a value of an attribute or even child element, whose type is xs:ID. I've been implementing support for schema-determined IDs for the XPointer.NET/XInclude.NET library (has ...

Dan Wahlin is blogging

Dan Wahlin, author of the "XML for ASP.NET Developers" book and xmlforasp.net portal, Microsoft MVP for XML Web Services, etc, is finally blogging. Really better late than never. ...

October 5, 2004

Mark: XmlResolvers article and new edition of the "A First Look at ADO.NET and System.Xml V2.0" book

Mark Fussell: In between re-writing and updating the chapters for the beta version of the my book A First Look at ADO.NET and System.Xml V2.0, I found some time to write an article on Building Custom XmlResolvers for MSDN. It's really good artilce, highly recommended reading for those who still ...

October 2, 2004

How to join XQP project

Well, here are some clarifications on how to join XQP project. You have to be registered at the SourceForge.net (here is where you can get new user accout) and then send some free-worded request along with SourceForge user name to me. That's it. Oh, and subscribe to the xqp-development mail ...

September 28, 2004

Got a new toy: XQP (XML Query Processor) project

Well, I was talking about it a lot and finally decided to stop rambling and start doing. Here is my new toy: XQP project. XQP stands for XML Query Processor of course. It's going (if my karma is good enough) to be free open-source XPath2.0/XQuery1.0/XSLT2.0 engine for the .NET platform ...

XInclude.NET progress

Well, XInclude.NET workspace at GotDotNet seems to be severely broken. I've sent a solid dozen of requests to fix it and now they even don't answer. Ok, moving the project to sf.net, specifically to the Mvp-Xml project. I'm adding XInclude.NET v1.2 sources to the CVS right now. After some setup ...

September 26, 2004

Late time changes are harmful - EXSLT.NET 1.1.1

As it turned out unfortunatley I introduced nasty bug into date:day-name(), date:day-abbreviation() and date:month-abbreviation() functions while testing EXSLT.NET 1.1 before the release. Saturday and December never appeared :( Thanks to Chris Bayes for prompt bug report. Hence - EXSLT.NET 1.1.1 release. Please update. ...

September 20, 2004

mvp-xml-help mail list created

I have just created first public mail list for the Mvp-Xml project - mvp-xml-help mail list. mvp-xml-help list is general discussion list for all users of the Mvp-Xml project.The allowed topics on this list are:Asking for help or helping others on using Mvp-Xml libraries.General announces related to the Mvp-Xml project.Suggestions ...

September 17, 2004

GotDotNet woes

So I'm in a critic mood today... I recently found out that XInclude.NET workspace is down for at least a month. Not surprisingly the feedback on the "Combining XML Documents with XInclude" article was so low - all the article links to XInclude.NET: homepage, message board and bug tracker are ...

September 14, 2004

Alternative download location for the EXSLT.NET 1.1

Well, GotDotNet seems to be down sometimes :). Just in case here is alternative download location for the EXSLT.NET 1.1: http://www.xmland.net/exslt/EXSLT.NET-1.1.zip. ...

September 13, 2004

EXSLT.NET 1.1 released

Here we go again - I'm pleased to announce EXSLT.NET 1.1 release. It's ready for download. The blurb goes here: EXSLT.NET library is community-developed free open-source implementation of the EXSLT extensions to XSLT for the .NET platform. EXSLT.NET fully implements the following EXSLT modules: Dates and Times, Common, Math, Random ...

September 5, 2004

EXSLT.NET progress

Lots of activity in the EXSLT.NET project recently. We implemented more functions such as random:random-sequence(), str:encode-uri() and str:decode-uri(). Lots of bugs have been fixed. Support for time zone in date-time functions has been implemented. We switched to Visual Studio .NET 2003 so simplifying our custom build process. Currently I'm writing ...

August 15, 2004

My EXSLT.NET article is live at MSDN

My latest article "Building Practical Solutions with EXSLT.NET" has been published at the MSDN XML Developer Center. This is an overview of the EXSLT.NET library and its extension functions from the practical XPath/XSLT programming point of view. Basically I wanted to show how to use EXSLT.NET functionality in practice, so ...

July 25, 2004

SgmlReader and namespaces

It's obvious, but I didn't realize that till recently - Chris Lovett's SgmlReader doesn't supprot namespaces. Why? SgmlReader is SGML reader in the first place and you know, there is no namespaces in SGML. So whenever you want to cheat and process malformed XML with SgmlReader - beware of namespaces. ...

July 22, 2004

How to get ASCII encoded XML document while writing arbitrary unicode data (e.g. when transforming with XslTransform class)

Sometimes some of us want to narrow encoding of an output XML document, while to preserve data fidelity. E.g. you transform some XML source with arbitrary Unicode text into another format and you need the resulting XML document to be ASCII encoded (don't ask me why). Here is fast and ...

June 24, 2004

Efficient subtree transformation with SubtreeXPathNavigator

Daniel implemented SubtreeXPathNavigator I was talking about. That's a way cool stuff, I really like it. Now I'm not sure about XmlNodeNavigator - do we need it in Mvp.Xml library or we better remove it to not confuse users with different forms of the same navigator? I feel a bit ...

June 21, 2004

Validating Doctype-less documents against DTD

Here is another interesting puzzle to solve - how would you validate Doctype-less XML document (which has no Doctype declaration) against DTD? ...

June 15, 2004

How to add a reference to XSLT stylesheet while writng DataSet data to XML

Say you've got a DataSet and you want to save its data as XML. DataSet.WriteXml() method does it perfectly well. But what if you need saved XML to have a reference to an XSLT stylesheet - xml-stylesheet processing instruction, such as <?xml-stylesheet type="text/xsl" href="foo.xsl"?> ? Of course you can load ...

June 8, 2004

MSDN still suggests ineffective XSLT pipelining

Reading wonderful "Chapter 9 - Improving XML Performance": Split Complex Transformations into Several Stages You can incrementally transform an XML document by using multiple XSLT style sheets to generate the final required output. This process is referred to as pipelining and is particularly beneficial for complex transformations over large XML ...

May 16, 2004

Improving XML Performance

Here is another piece of a must reading - "Chapter 9 - Improving XML Performance" of the "Improving .NET Application Performance and Scalability" guide from the Microsoft Pattern and Practices group. Here are the objectives : Optimize XML processing design, Parse XML documents efficiently, Validate XML documents efficiently, Optimize your ...

May 12, 2004

Transforming only a part of XML document

Daniel writes about transforming a portion of XML document using XPathNavigatorReader. That's a common bad surprise for MSXML-experienced people, who used to fooNode.transformNode() method, where only fooNode and its descendants are visible in XSLT. In .NET that's different - no matter which DOM node you pass to XslTransform.Transform() method, the ...

April 12, 2004

Cut API

So Dare said it - unfortunately XmlAdapter and XPathChangeNavigator won't make it into System.Xml v2.0. Funny enough, but looks like I was right in my assumption about what's gonna be cut. Well, without these System.Xml v2.0 probably won't be so harmonious and beautiful as Mark has described in his "First ...

March 30, 2004

Xerces.NET???

May be I missed something, but looks like Travis Bright is converting Apache Xerces XML parser to .NET. I wonder what for? Aha, he's PM for the Java Language Conversion Assistant (JLCA). That explains. Btw, one day I stumbled across CSS parsing in .NET. Java version of the product I've ...

RE: Do we need SAX for .NET? (or does Java ports to C# make sense?)

Daniel says he's disappointed in SAX.NET project I was writing about. Unlike lazy me, he downloaded it and inspected implementation. Well, I mostly agree with him. This piece of direct thoughtless porting of complex convolute Java API to .NET looks weird and kinda unnatural. "namespace System.Xml.Sax {" isn't what I ...

EXSLT.NET and ASP.NET security woes

A long and convolute discussion about security problems of using EXSLT.NET in ASP.NET took place in EXSLT.NET message board. Here I'd like to formulate some short summary. ...

March 22, 2004

SAX for .NET?

Hey, SAX for .NET topic is becoming hot. I was aware of one implementation (to be unveiled really soon), being developed by my fellow MVP/XmlInsider, but apparently there is another one, by Karl Waclawek. Here is what he writes in xml-dev mail list: The SAX dot NET project on SourceForge ...

March 16, 2004

XML Bestiary: IndexingXPathNavigator

Here I go again with another experimental creature from my XML Bestiary: IndexingXPathNavigator. This one was inspired by Mark Fussell's "Indexing XML, XML ids and a better GetElementByID method on the XmlDocument class". I've been experimenting with Mark's extended XmlDocument, played a bit with XPathDocument and "idkey()" extension function Mark ...

March 14, 2004

ASP.NET XML syntax?

XAML, Windows Forms Markup Language (WFML), Report Definition Language (RDL), Relational Schema Definition (RSD) and Mapping Schema Definition (MSD). You get the idea what the trend is nowadays. It's all XML. What I'm wondering though - why still there is no alternative ASP.NET XML-based syntax? How long ASP.NET will stay ...

March 10, 2004

random:random-sequence() at large

Ok, I've implemented EXSLT Random module, which consists of the only function random:random-sequence() for EXSLT.NET library. Here is how it looks now: ...

March 7, 2004

Why XmlReader Usage Pattern Ignores NameTable?

Somehow it happened that one of the most commonly used XmlReader usage patterns ignores NameTable. That's really unfortunate! Everybody, including Microsofties, MVPs and of course zillions of users blindly follow it, carelessly slowing down XmlReader's parsing speed. ...

March 4, 2004

On XML Catalogs

XML.com has published good article "Using XML Catalogs with JAXP". XML Catalogs are successors of SGML Catalogs and in simple words it's a system for defining resolving of resource identifiers (URIs or Public Identifiers) in XML. If you are .NET minded - it's about having XML document (called catalog), where ...

March 2, 2004

EXSLT Random module for EXSLT.NET

I'm going to implement EXSLT Random module for EXSLT.NET lib. It contains the only extension function: number+ random:random-sequence(number?, number?) The function returns a sequence of random numbers between 0 and 1 (as text nodes obviously). The first argument is number or random numbers to generate (1 by default) and the ...

XInclude Tough Destiny

Dare writes: We were planning to add support for xml:base to the core XML parser as part of implementing XInclude but given that that it recently went from being a W3C candidate recommendation to going back to being a W3C working draft (partly due to a number of the architectural ...

February 26, 2004

Streaming XInlcude gets blessing

At last some good news. Streaming subset of XInclude I was talking about gets blessing from the W3C XML Core WG. Here is what Jonathan Marsh (MSFT, editor of XInclude) writes: It appears to be impossible to improve streamability without removing functionality from XInclude. The WG decided instead to bless ...

February 25, 2004

XInclude.NET logo contest

Well, I know I stink on graphics. Yesterday I tried to develop a logo for the XInclude.NET project and here is what I ended up. The idea was about Lego and intergration or parts into a round thing, whatever. I'd like to hear what do you guys think about this ...

Bad Monday and XInclude.NET development

When your hard disk dies Monday morning, that's nice week start. Low type tasks on recovering your data, sources, reinstalling and configuring all the stuff you cannot work without... Refreshing. Basically I've recovered already. Surprisingly I cannot now install Office 2003, it says "You've got McAffee VirusScan Enterprise installed, Office ...

February 21, 2004

nxslt.exe Command Line Utility

Dummy entry to provide single place for nxslt.exe utility comments. ...

February 19, 2004

XML Bestary Updated

I've updated my XML Bestiary as a consequence of users and my own feedback. First of all I renamed WritableXPathNavigator to SerializableXPathNavigator. That's much less confusing name IMO. Beside that I unified all distributions (the same namespace, project structure etc). More beasts to come soon, I've got several growing up ...

February 18, 2004

Streaming XInclude and Intra-document References

It's definitely love-to-steaming-strikes-back day today. Here is another sample of how streaming XML processing approach fails. The only XInlcude feature still not implemented in XInlcude.NET project is intra-document references. And basically I have no idea how to implement it in .NET pull environment (as well as Elliotte Rusty Harold has ...

ForwardXPathNavigator vs XSE: a class vs API

Meanwhile I managed to create simple dummy online demo of ForwardXPathNavigator (XPathNavigator implementation over XmlReader) I was talking about. Here it is. ...

XSE idea

Here is Daniel clarifies things about XSE: XSE is not about querying with an specific expression language/format (i.e. XPath or SXPath). XSE is just a mechanism for encapsulating state machines checking for matches against a given expression. What the expression looks like depends on the factory that creates the strategy ...

February 16, 2004

RE: Streaming XPath and ForwardXPathNavigator

Ok, Dare great deal clarified things in his "Combining XPath-based Filtering with Pull-based XML Parsing" post: Actually Oleg is closer and yet farther from the truth than he realizes. Although I wrote about a hypothetical ForwardOnlyXPathNavigator in my article entitled Can One Size Fit All? for XML Journal my planned article ...

February 15, 2004

Warriors of Streaming XPath Order

Daniel writes about performant (and inevitably streaming) XML processing, introducing XSEReader (aka Xml Streaming Events Reader). While he didn't publish the implementation itself yet, but only teasing with samples of its usage, I think I get the idea. Basically I know what he's talking about. I've been playing with such ...

February 4, 2004

XML Bestiary: SerializableXPathNavigator - InnerXml/OuterXml for XPathNavigator

Dare has been talking recently about the disconnects developers may feel once they make the shift from tree based (XmlDocument) to cursor based (XPathNavigator) model. My personal XML learning curve has started with DOM (I remember those long convolute ugly DOM navigational programs I wrote back in Y2K), then I ...

February 3, 2004

I love XmlResolvers

Did you know XslTransform class allows custom XmlResolver to return not only Stream (it's only what default XmlResolver implementation - XmlUrlResolver class supports), but also XPathNavigator! Sounds like undeservedly undocumented feature. What it gives us? Really efficient advanced XML resolving scenarios such as just mentioned recently on asp.net XML forum ...

February 1, 2004

EXSLT.NET rocks

Have you noted this thread in microsoft.public.dotnet.xml newsgroup? A guy was trying to get list of unique values from XML document of 46000 records. Using Muenchian grouping method. For MSXML4 it took 20 seconds, while in .NET 1.0 and 1.1 it effectively hung.Well, as all we know Muenchian method works ...

January 18, 2004

The Name Of The Beast

Somehow many believe it's impossible to get OuterXml/InnerXml out of XPathNavigator, but in fact it's merely one-screen-of-code class. And by the way, in System.Xml v2 XPathDocument2 class does have such properties already. So I've written a small class, which exposes this omitted functionality. It's lightweight wrapper around XPathNavigator, which adds ...

January 15, 2004

How to kill DOM

In the beginning Microsoft created the Microsoft.XMLDOM, known today as Msxml2.DOMDocument. And people like(d) it much. Then .NET happened and people were given XmlReader, XmlWriter, XmlDocument, XPathDocument, XPathNavigator and XmlDataDocument. Surprisingly most of us stuck to XmlDocument for no-matter-which scenario. Now we've been notified the Gods decided to kill XmlDocument ...

January 11, 2004

SgmlReader gets updated

Chris Lovett has released SgmlReader version 1.2. It's mostly bug fixes release. Via Dare Obasanjo aka Carnage4Life SgmlReader is an XmlReader, which is able to parse SGML documents (e.g. HTML). ...