Excellent post on XSL-List by Abel Braaksma on creating readable regex expressions in XSLT 2.0. He suggests always defining regular expressions in the content of a
<xsl:variable>, using normal XML comments to annotate the different parts of the regex, and then using the
x flag to ignore the extraneous whitespace that you’ve introduced.
More rules of thumb: these are about when to use matching templates, when to use named templates, and when to use for-each. These have as much bearing in XSLT 1.0 as they do in XSLT 2.0.
In XSLT 2.0, functions and templates have very similar behaviour: both can accept arguments/parameters and return sequences of any kind. The difference is in how they’re called: functions can be called concisely from within expressions and patterns, and arguments are passed by position; whereas templates have to be called using
<xsl:call-template>, and parameters are passed by name. Also, there’s no context node for functions, but there is one for templates. I’ve built up some rules of thumb about which to use when:
My dad (Hello Barry!) has much more time to surf than I do, and often sends me interesting links. One that he sent recently was a video presentation of a multi-touch interface that’s really worth checking out. I thought I’d just write down a few of my thoughts on that and one of the talks at DocEng 2006 on interactive paper, since they’re both about how we might interact with computers in more intuitive ways in the future.
The problem: You’re using MSXML (and therefore XSLT 1.0). You’re outputting XHTML (and therefore using the
xml method). You want to output an empty
<a> element for an anchor, but want to make sure that you get a start tag and and end tag (
<a id="foo"></a>) rather than an empty element tag (
Is the only solution disable-output-escaping?