views:

336

answers:

3

Hello.

I'm using xslt transformer in my C++ Win32 application and several xsl files that have a common part that I would like to separate into another xsl file. All xsl files are stored as resources. The only way I encountered for xsl:include is using res:// protocol that does not work properly for xsl files (at least on two of my Windows installations loading of resulting xslt file returned an error and on one installation it worked allright). MSDN also mentions about the problem: http://support.microsoft.com/?scid=kb%3Ben-us%3B220830&x=13&y=12

Do I have any other options except:

  1. Implementing my own protocol handler for loading included xsl files - does not worth doing.
  2. Avoiding <xsl:include> and substituting included files myself - too clumsy.
  3. Duplication of common part in all templates - no, thanks.
A: 

What version of C++ are you using and are you using MSXML (again, what version) or System.Xml?

Tautologistics
A: 

I'm using MS Visual Studio 2005 and Windows built-in XSLT processor (msxml?.dll), starting with the one that comes with Windows XP. Unfortunately, I can not redistribute msxml?.dll with my application. Is there any possibility to do the trick with another XSLT processor? Probably there's one that comes with GPL license and suits my needs (and also supports XSLT 2.0 that would be excellent)? What is System.xml?

+1  A: 

Two other xml/xslt libraries are Xerces (http://xerces.apache.org/xerces-c/ - there's also a java flavour IIRC) and libxml (http://xmlsoft.org/). I started with Xerces and ended up using libxml (both with C++), but I don't really like either of them: neither seems to correspond to my perception of what needs to be done - perhaps my failing. I found libxml more hackable though.

Also, I used these with VC6, but I don't think your version would kick up about them.

mr calendar