Skip to content

Instantly share code, notes, and snippets.

@tushortz
Last active July 6, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tushortz/c7b84a44f02e812bfba94888a779db55 to your computer and use it in GitHub Desktop.
Save tushortz/c7b84a44f02e812bfba94888a779db55 to your computer and use it in GitHub Desktop.
visual studio code xslt snippet
{
// Place your snippets for xsl here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"xsl:apply-imports": {
"prefix": "xsl:apply-imports",
"body": [
"<xsl:apply-imports$1>"
],
"description": "Invokes an overridden template rule."
},
"xsl:apply-templates": {
"prefix": "xsl:apply-templates",
"body": [
"<xsl:apply-templates$1>"
],
"description": "Directs the XSLT processor to find the appropriate template to apply, based on the type and context of each selected node."
},
"xsl:attribute": {
"prefix": "xsl:attribute",
"body": [
"<xsl:attribute$1>"
],
"description": "Creates an attribute node and attaches it to an output element."
},
"xsl:attribute-set": {
"prefix": "xsl:attribute-set",
"body": [
"<xsl:attribute-set$1>"
],
"description": "Defines a named set of attributes."
},
"xsl:call-template": {
"prefix": "xsl:call-template",
"body": [
"<xsl:call-template$1>"
],
"description": "Invokes a template by name."
},
"xsl:choose": {
"prefix": "xsl:choose",
"body": [
"<xsl:choose$1>"
],
"description": "Provides multiple conditional testing in conjunction with the <xsl:otherwise> element and <xsl:when> element."
},
"xsl:comment": {
"prefix": "xsl:comment",
"body": [
"<xsl:comment$1>"
],
"description": "Generates a comment in the output."
},
"xsl:copy": {
"prefix": "xsl:copy",
"body": [
"<xsl:copy$1>"
],
"description": "Copies the current node from the source to the output."
},
"xsl:copy-of": {
"prefix": "xsl:copy-of",
"body": [
"<xsl:copy-of$1>"
],
"description": "Inserts subtrees and result tree fragments into the result tree."
},
"xsl:decimal-format": {
"prefix": "xsl:decimal-format",
"body": [
"<xsl:decimal-format$1>"
],
"description": "Declares a decimal-format, which controls the interpretation of a format pattern used by the format-number function."
},
"xsl:element": {
"prefix": "xsl:element",
"body": [
"<xsl:element$1>"
],
"description": "Creates an element with the specified name in the output."
},
"xsl:fallback": {
"prefix": "xsl:fallback",
"body": [
"<xsl:fallback$1>"
],
"description": "Calls template content that can provide a reasonable substitute to the behavior of the new element when encountered."
},
"xsl:for-each": {
"prefix": "xsl:for-each",
"body": [
"<xsl:for-each$1>"
],
"description": "Applies a template repeatedly, applying it in turn to each node in a set."
},
"xsl:if": {
"prefix": "xsl:if",
"body": [
"<xsl:if$1>"
],
"description": "Allows simple conditional template fragments."
},
"xsl:import": {
"prefix": "xsl:import",
"body": [
"<xsl:import$1>"
],
"description": "Imports another XSLT file."
},
"xsl:include": {
"prefix": "xsl:include",
"body": [
"<xsl:include$1>"
],
"description": "Includes another XSLT file."
},
"xsl:key": {
"prefix": "xsl:key",
"body": [
"<xsl:key$1>"
],
"description": "Declares a named key for use with thekey() function in XML Path Language (XPath) expressions."
},
"xsl:message": {
"prefix": "xsl:message",
"body": [
"<xsl:message$1>"
],
"description": "Sends a text message to either the message buffer or a message dialog box."
},
"xsl:namespace-alias": {
"prefix": "xsl:namespace-alias",
"body": [
"<xsl:namespace-alias$1>"
],
"description": "Replaces the prefix associated with a given namespace with another prefix."
},
"xsl:number": {
"prefix": "xsl:number",
"body": [
"<xsl:number$1>"
],
"description": "Inserts a formatted number into the result tree."
},
"xsl:otherwise": {
"prefix": "xsl:otherwise",
"body": [
"<xsl:otherwise$1>"
],
"description": "Provides multiple conditional testing in conjunction with the <xsl:choose> element and <xsl:when> element."
},
"xsl:output": {
"prefix": "xsl:output",
"body": [
"<xsl:output$1>"
],
"description": "Specifies options for use in serializing the result tree."
},
"xsl:param": {
"prefix": "xsl:param",
"body": [
"<xsl:param$1>"
],
"description": "Declares a named parameter for use within an <xsl:stylesheet> element or an <xsl:template> element. Allows you to specify a default value."
},
"xsl:preserve-space": {
"prefix": "xsl:preserve-space",
"body": [
"<xsl:preserve-space$1>"
],
"description": "Preserves white space in a document."
},
"xsl:processing-instruction": {
"prefix": "xsl:processing-instruction",
"body": [
"<xsl:processing-instruction$1>"
],
"description": "Generates a processing instruction in the output."
},
"msxsl:script*": {
"prefix": "msxsl:script*",
"body": [
"<msxsl:script*$1>"
],
"description": "Defines global variables and functions for script extensions."
},
"xsl:sort": {
"prefix": "xsl:sort",
"body": [
"<xsl:sort$1>"
],
"description": "Specifies sort criteria for node lists selected by <xsl:for-each> or <xsl:apply-templates>."
},
"xsl:strip-space": {
"prefix": "xsl:strip-space",
"body": [
"<xsl:strip-space$1>"
],
"description": "Strips white space from a document."
},
"xsl:stylesheet": {
"prefix": "xsl:stylesheet",
"body": [
"<xsl:stylesheet$1>"
],
"description": "Specifies the document element of an XSLT file. The document element contains all other XSLT elements."
},
"xsl:template": {
"prefix": "xsl:template",
"body": [
"<xsl:template$1>"
],
"description": "Defines a reusable template for generating the desired output for nodes of a particular type and context."
},
"xsl:text": {
"prefix": "xsl:text",
"body": [
"<xsl:text$1>"
],
"description": "Generates text in the output."
},
"xsl:transform": {
"prefix": "xsl:transform",
"body": [
"<xsl:transform$1>"
],
"description": "Performs the same function as <xsl:stylesheet>."
},
"xsl:value-of": {
"prefix": "xsl:value-of",
"body": [
"<xsl:value-of$1>"
],
"description": "Inserts the value of the selected node as text."
},
"xsl:variable": {
"prefix": "xsl:variable",
"body": [
"<xsl:variable$1>"
],
"description": "Specifies a value bound in an expression."
},
"xsl:when": {
"prefix": "xsl:when",
"body": [
"<xsl:when$1>"
],
"description": "Provides multiple conditional testing in conjunction with the <xsl:choose> element and <xsl:otherwise> element."
},
"xsl:with-param": {
"prefix": "xsl:with-param",
"body": [
"<xsl:with-param$1>"
],
"description": "Passes a parameter to a template."
},
"name attribute": {
"prefix": "name",
"body": [
"name=\"$1\""
],
"description": "name attribute"
},
"version attribute": {
"prefix": "version",
"body": [
"version=\"${1:1.0}\""
],
"description": "version attribute"
},
"xmlns:xml namespace attribute": {
"prefix": "xmlns",
"body": [
"xmlns:xsl=\"${1:http://www.w3.org/1999/XSL/Transform}\""
],
"description": "xmlns attribute"
},
"match attribute": {
"prefix": "match",
"body": [
"match=\"${1:/}\""
],
"description": "match attribute"
},
"method attribute": {
"prefix": "method",
"body": [
"method=\"${1:xml}\""
],
"description": "method attribute"
},
"omit xml declaration attribute": {
"prefix": "omit xml declaration",
"body": [
"omit-xml-declaration=\"${1:yes}\""
],
"description": "omit xml declaration attribute"
},
"select attribute": {
"prefix": "select",
"body": [
"select=\"${1}\""
],
"description": "select attribute"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment