AutoHotKey XSL
The following are some AutoHotKey shortcuts that are useful in editing XSL documents (in the XslGenerator control, for instance).
Installation
- Right-click the AutoHotKey icon, select "Edit This Script" and add these lines to the Notepad document
- Then, right-click the AutoHotKey icon again and select "Reload This Script".
::xtemplate::
sendinput, <xsl:template match="">`n`t<xsl:value-of select="" />`n</xsl:template>{up}{up}{end}{left}{left}
return
::xtemplaten::
sendinput, <xsl:template name="">`n`t<xsl:param name="" />`n</xsl:template>{up}{up}{end}{left}{left}
return
::xapply::
sendinput, <xsl:apply-templates select="" />{left}{left}{left}{left}
return
::xcall::
sendinput, <xsl:call-template name="">`n`t<xsl:with-param name="" select="" />`n`t<xsl:with-param name=""><xsl:value-of select="" /></xsl:param>`n</xsl:call-template>{up}{up}{up}{end}{left}{left}
return
::xvalue::
sendinput, <xsl:value-of select="" />{left}{left}{left}{left}
return
::xattribute::
sendinput, <xsl:attribute name="">`n`t<xsl:value-of select="" />`n</xsl:attribute>{up}{up}{end}{left}{left}
return
::xfor::
sendinput, <xsl:for-each select="">`n`t<xsl:value-of select="" />`n</xsl:for-each>{up}{up}{end}{left}{left}
return
::xsort::
sendinput, <xsl:sort select="" />{left}{left}{left}{left}
return
::xif::
sendinput, <xsl:if test="key{!}=''">`n`t<xsl:value-of select="" />`n</xsl:if>{up}{up}{end}{left}{left}{left}
return
::xchoose::
sendinput, <xsl:choose>`n`t<xsl:when test="key{!}=''">`n`t`t<xsl:value-of select="" />`n`t</xsl:when>`n`t<xsl:otherwise>`n`t`t<xsl:value-of select="" />`n`t</xsl:otherwise>`n</xsl:choose>{up}{up}{up}{up}{up}{up}{end}{left}{left}{left}
return
Usage
Type:
xchoose{tab}
Result:
<xsl:choose>
<xsl:when test="key!=''">
<xsl:value-of select="" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="" />
</xsl:otherwise>
</xsl:choose>
Then modify the template.