tags:

views:

85

answers:

3

I'm adding XSLT support to one of our products in the last few weeks. To do that, I've been experimenting with using the microsoft MSXML libraries to transform the XML and XSL files.

Parsing with MSXML basically works, but I've run into a couple of places where it won't support certain things that XSL should allow. This makes me worry that it isn't 100% standards compliant, and that perhaps using it might cause us problems in the future. For example, it doesn't seem to generate proper starting tags that specify standards compliant HTML, and declaring new entities at the start of the document doesn't seem to work.

Does anyone have experience with using MSXML for XSLT stuff, and did you run into any problems doing it?

Or, do any windows developers here have suggestions for alternative XSL parsers that I can use? I need a way to take an XML file and an XSL file, and generate an HTML file based on them. (The functions must be able to be called from C or C++ in win32 code.)

+1  A: 

From what I've seen with XML + XSLT and Internet Explorer (7), thus in other words: MSXML... As long as you limit yourself to XSLT 1.0 you should be mostly fine except that namespace support may leave something to be desired. However it means you don't have many of the nicer XPath functions...

Alternatively you can use e.g. libxml which offers similar functionality; or you can use something by the Apache projects...

+1  A: 

Using 'Xerces' for cross platform and picked up 'Xalan' for doing XSLT.

There where a few minor differences we noted between MSXML and Xerces. We had to change the transform slightly between these engines, MSXML seemed to be the less standard one. If your not worried about cross platform, I'd try with both of these and see which one works with your transform best.

You might like to look at 'Oxygen' XML editor aswell, for us it had the best XSLT support where you could pick which XSLT engine to use, good to see what the differences are, but also great to work with the same engine interactivly for debugging that you will use in your final app.

Greg Domjan
+1  A: 

On windows, I've used both MSXML and Xerces/Xalan. I'd lean more towards MSXML, because you are on a Windows environment. I've used it successfully on a number of projects, ranging from desktop to web applications, over the years.

One caveat is that MSXML is a COM based API. XPath 2.0 support in Xalan was started, but has come to a halt. There are also concerns that future development of Xalan is in doubt. There is also libxslt and XQilla, which both have Windows support, but I have no experience using either of them.

Garett