JSP JSTL < x: param > tag: define parameters


parameter value

Example

<%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <c:import url="personnel.xml" var="xmlFile" charEncoding="gbk"/>
    <c:import url="personnel.xsl" var="xsltFile" charEncoding="gbk"/>
    <x:transform doc="${xmlFile}" xslt="${xsltFile}">
      <x:param name="paraName" value="wgh"></x:param>
    </x:transform>
<?xml version="1.0" encoding="gbk"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="paraName"/>
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  <xsl:template match="personnel">
    <html>
      员工信息<br/>
      <xsl:apply-templates/>
    </html>
  </xsl:template>
  <xsl:template match="person">
    <xsl:if test="name/@ value!=$paraName">
      <div style="font-size:9pt;">
        <pre>
<xsl:value-of select="name/@value"/>|<xsl:value-of select="kNowledge"/>
|<xsl:value-of select="memo/@value"/>
</pre>
      </div>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>