Another alternative to purchasing a hexadecimal calculator is to obtain a TSR (Terminate and Stay Resident) program such as SideKick which contains a built-in calculator. However, unless you already have one of these programs, or you need some of the other features they offer, such programs are not a particularly
...
"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
...
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.
...
exsl:object-type() function brings a bit of reflection functionality into XSLT allowing dynamic type identification at runtime. That is using exsl:object-type() one can determine type of an object, e.g. a type of passed parameter value. In XSLT 1.0 type system that means 'string', 'number', 'boolean', 'node-set', 'RTF' or 'external':
Node type:
String type:
Boolean type:
Number type:
RTF type:
The result is:
Node type: node-set
String type: string
Boolean type: boolean
Number type: number
RTF type: RTF
Provided weakly typed nature of XSLT 1.0 this function can become really useful for employing defensive programming (e.g. to assert that a parameter passed to a named template contains actually a nodeset), testing or even
debugging.
For a sample of defensive programming using exsl:object-type() function consider the following dummy stylesheet:
util42 template expects parameter $nodes to be a nodeset,
not ''!
Here util42 template before doing any work asserts than actual parameter value passed is a nodeset, not anything else. If you comment out that <xsl:if> test, you'll get the following transformation error:
XslTransformException
---------------------
To use a result tree fragment in a path expression, first convert it to a node-set
using the msxsl:node-set() function.
Well, as usual with automatic error messages - at least unclear. Now with object type check you should get this:
XslTransformException
---------------------
util42 template expects parameter $nodes to be a nodeset, not 'RTF'!
Definitely more meaningful and safe. And of course it's now up to template author whether to terminate transformation or to recover.
Pretty useful fiunction. And when it comes to QA - that's a godsend. As a matter of interest, AFAIK exsl:object-type() function was implemented to help Microsoft XML Team with XslCompiledTransform testing in the first place.
I've got an invitation to participate in Yahoo! Publisher Network Beta program, which seems to be another targeted ad system just like Google AdSense, but already supporting ads in RSS feeds. They support MovableType and WordPress. Alas I couldn't even login - it's currently USA only and USA tax information
...