xsl.examples.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 72 行
HTML
72 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Examples</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xsl.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.xsltprocessor.html">XSLTProcessor</a></div> <div class="up"><a href="book.xsl.html">XSL</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Examples</h1> <div id="xsl.examples-collection" class="section"> <p class="para"> Many examples in this reference require both an XML and an XSL file. We will use <var class="filename">collection.xml</var> and <var class="filename">collection.xsl</var> that contains the following: </p> <p class="para"> <div class="example"> <p><b>Example #1 collection.xml</b></p> <div class="example-contents"><div class="cdata"><pre><collection> <cd> <title>Fight for your mind</title> <artist>Ben Harper</artist> <year>1995</year> </cd> <cd> <title>Electric Ladyland</title> <artist>Jimi Hendrix</artist> <year>1997</year> </cd></collection></pre></div> </div> </div> <div class="example"> <p><b>Example #2 collection.xsl</b></p> <div class="example-contents"><div class="cdata"><pre><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="owner" select="'Nicolas Eliaszewicz'"/> <xsl:output method="html" encoding="iso-8859-1" indent="no"/> <xsl:template match="collection"> Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection! <xsl:apply-templates/> </xsl:template> <xsl:template match="cd"> <h1><xsl:value-of select="title"/></h1> <h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> <hr /> </xsl:template></xsl:stylesheet></pre></div> </div> </div> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xsl.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.xsltprocessor.html">XSLTProcessor</a></div> <div class="up"><a href="book.xsl.html">XSL</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?