Skip to content

Instantly share code, notes, and snippets.

@shaunix

shaunix/xlim-examples.txt

Last active Jun 9, 2016
Embed
What would you like to do?
XSLT:
<xsl:variable name="linkid">
<xsl:call-template name="mal.link.linkid">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:variable>
Xlim:
$ linkid = mal.link.linkid @ node
-----------------------------------------------------------------
XSLT:
<xsl:param name="groups">
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="$node/@groups">
<xsl:value-of select="$node/@groups"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>#default</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text> </xsl:text>
</xsl:param>
Xlim:
@ groups
' '
choose
select $node/@groups
otherwise
'#default'
' '
-----------------------------------------------------------------
XSLT:
<xsl:template mode="mal2html.block.mode" match="mal:p">
<xsl:variable name="if">
<xsl:call-template name="mal.if.test"/>
</xsl:variable>
<xsl:if test="$if != ''">
<p>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>p</xsl:text>
<xsl:if test="contains(concat(' ', @style, ' '), ' lead ')">
<xsl:text> lead</xsl:text>
</xsl:if>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="mal2html.inline.mode"/>
</p>
</xsl:if>
</xsl:template>
Xlim:
template mal2html.block.mode on mal:p
variable if = mal.if.test
if $if != ''
p
= html.class.attr
@ class
'p'
if ~ @style 'lead'
' lead'
if $if != 'true'
' if-if '
select $if
= html.lang.attrs
= mal2html.inline.mode on node()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.