📄 recipe.xsl
字号:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/recipe">
<HTML>
<HEAD>
<TITLE>
<xsl:value-of select="title"/>
</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="/recipe/title">
<H1>
<xsl:apply-templates/>
</H1>
</xsl:template>
<xsl:template match="/recipe/description">
<P>
<xsl:apply-templates/>
</P>
</xsl:template>
<xsl:template match="/recipe/ingredients">
<H3>Ingredients</H3>
<UL>
<xsl:apply-templates/>
</UL>
</xsl:template>
<xsl:template match="/recipe/ingredients/item[@units='none']" xml:space="preserve">
<LI>
<xsl:value-of select="@num"/> <xsl:apply-templates/>
</LI>
</xsl:template>
<xsl:template match="/recipe/ingredients/item[@units!='none']" xml:space="preserve">
<LI>
<xsl:value-of select="@num"/> <xsl:value-of select="@units"/><xsl:apply-templates/>
</LI>
</xsl:template>
<xsl:template match="/recipe/directions">
<H3>Directions</H3>
<P>
<xsl:apply-templates/>
</P>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -