Random photo
Loading...
Domains for sale
|
January 15, 2006Detecting version of Microsoft XSLT engine from within XSLTSometimes 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 within XSLT stylesheet may be vital requirement. Here is how it can be done. MSXML supports "ms:version" system property, which can be retrieved using standard XSLT system-property() function. The value returned is MSXML version - "3", "4", "5" and so on. XslTransform doesn't support "ms:version" property and returns empty string (just like any other non-Microsoft XSLT engine). But new XslCompiledTransform does support it and "returns a string representing the version of the assembly implementing XslCompiledTransform in the same format as returned by Assembly.ImageRuntimeVersion property ('v2.0.50727' for .NET Framework 2.0)." This, along with standard 'xsl:vendor' property should give us enough information to differentiate between Microsoft XSLT engines. Here is a sample XSLT stylesheet that does the trick:
This XSLT stylesheet is being executed using
Through a solid
Microsoft Exchange server in-house or paying for
Exchange email outsourcing you'll have access to a
Microsoft Exchange server that lets you access email and shared calendars
worldwide through
Exchange 2007 hosting software.
Comments
Post a comment
Listed below are links to weblogs that reference this post:
XSLT Stylesheet Performance on Big Ass Documents from ComputerZen.com - Scott Hanselman |