wskplho / zen-coding

Automatically exported from code.google.com/p/zen-coding
1 stars 0 forks source link

XSL Updated settings #338

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have updated the XSL settings in zen_settings.py for those who use it:

    'xsl': {
        'extends': 'common,html',
        'filters': 'html, xsl',
        'snippets': {
            'xsl': '<?xml version="1.0" encoding="${charset}"?>\n' +
                '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n' +
                '   \n' +
                '</xsl:stylesheet>',
            'out': '<xsl:output method="xml"\n' +
                    '   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"\n' +
                    '   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\n' +
                    '   omit-xml-declaration="yes"\n' +
                    '   encoding="${charset}"\n' +
                    '   indent="yes"/>\n',
        }
        'abbreviations': {

#           Templates
            'tm': '<xsl:template match="" mode=""></xsl:template>',
            'tmatch': 'tm',
            'tn': '<xsl:template name=""></xsl:template>',
            'tname': 'tn',
            'call': '<xsl:call-template name=""/>',
            'ap': '<xsl:apply-templates select=""/>',
            'ape': '<xsl:apply-templates select=""></xsl:apply-templates>',
            'apm': 'ap[mode]',
            'api': '<xsl:apply-imports/>',
            'imp': '<xsl:import href=""/>',
            'inc': '<xsl:include href=""/>',

#           Choice
            'xsl:choose': '<xsl:choose></xsl:choose>',
            'ch': 'xsl:choose',
            'xsl:when': '<xsl:when test=""></xsl:when>',
            'wh': 'xsl:when',
            'xsl:otherwise': '<xsl:otherwise></xsl:otherwise>',
            'ot': 'xsl:otherwise',
            'if': '<xsl:if test=""></xsl:if>',

#           Variables and Parameters
            'var': '<xsl:variable name="" select=""/>',
            'vare': '<xsl:variable name=""></xsl:variable>',
            'par': '<xsl:param name="" select=""/>',
            'pare': '<xsl:param name=""></xsl:param>',
            'wp': '<xsl:with-param name="" select=""/>',
            'key': '<xsl:key name="" match="" use=""/>',

#           Elements and Attributes
            'ele': '<xsl:element name=""></xsl:element>',
            'attr': '<xsl:attribute name=""></xsl:attribute>',
            'attrs': '<xsl:attribute-set name=""></xsl:attribute-set>',

#           Values and Iteration
            'co': '<xsl:copy-of select=""/>',
            'cp': '<xsl:copy select=""/>'
            'val': '<xsl:value-of select=""/>',
            'each': '<xsl:for-each select=""></xsl:for-each>',
            'for': 'each',
            'tex': '<xsl:text></xsl:text>',

#           Output
            'com': '<xsl:comment></xsl:comment>',
            'mess': '<xsl:message terminate="no"></xsl:message>',
            'fall': '<xsl:fallback></xsl:fallback>',
            'num': '<xsl:number value=""/>',
            'nam': '<namespace-alias stylesheet-prefix="" result-prefix=""/>',
            'pres': '<xsl:preserve-space elements=""/>',
            'strip': '<xsl:strip-space elements=""/>',
            'proc': '<xsl:processing-instruction name=""></xsl:processing-instruction>',
            'sort': '<xsl:sort select="" order=""/>',

#           expandos
            'choose+': 'xsl:choose>xsl:when+xsl:otherwise'
        }
    },

Original issue reported on code.google.com by john.por...@airlock.com on 29 May 2012 at 11:35

GoogleCodeExporter commented 8 years ago
Although after testing this, it doesn't actually work.

How can I add abbreviations in to the settings and have them actually work?

If anyone spots it, there is a comma missing, but even when fixed, it still 
doesn't output my abbreviations.

Original comment by john.por...@airlock.com on 29 May 2012 at 2:04

GoogleCodeExporter commented 8 years ago
I've done this and it works now: https://gist.github.com/2828995

Original comment by john.por...@airlock.com on 29 May 2012 at 3:23

GoogleCodeExporter commented 8 years ago
Thanks for your support!
I've implemented your snippets (althou slightly updated and refactored) in next 
release: 
https://github.com/sergeche/zen-coding/commit/ace413849a23d48419dad3c6163cacd4d3
26c6e3

Original comment by serge....@gmail.com on 14 Jun 2012 at 9:50