xslt 中<xsl:attribute name="@name">有办法实现吗?
时间:2011-07-28
来源:互联网
xml的内容:
<?xml version="1.0" encoding="utf-8"?>
<template name="onclick">
<action>
jsFunctionName
</action>
</template>
xsl的内容:
<xsl:apply-templates select"/">
<html>
<body>
<form>
<table>
<xsl:if test="@name">
<xsl:attribute name="@name"> <xsl:value-of select="./action"/>
</xsl:attribute>
</xsl:if>
</table>
</form>
</body>
<html>
</xsl:apply-templates>
<?xml version="1.0" encoding="utf-8"?>
<template name="onclick">
<action>
jsFunctionName
</action>
</template>
xsl的内容:
<xsl:apply-templates select"/">
<html>
<body>
<form>
<table>
<xsl:if test="@name">
<xsl:attribute name="@name"> <xsl:value-of select="./action"/>
</xsl:attribute>
</xsl:if>
</table>
</form>
</body>
<html>
</xsl:apply-templates>
作者: shanghuaipopu 发布时间: 2011-07-28
自己解决,水平太烂,暂时不知道为什么。但是效果出来啦。
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="template">
<html>
<head>
<title>333333333</title>
</head>
<body>
<table>
<xsl:if test="@name">
<xsl:attribute name="{@name}"> <xsl:value-of select="./action">
</xsl:value-of>
</xsl:attribute>
<tbody>
<tr>
<th><xsl:value-of select="./action">
</xsl:value-of></th>
</tr>
</tbody>
</xsl:if>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="template">
<html>
<head>
<title>333333333</title>
</head>
<body>
<table>
<xsl:if test="@name">
<xsl:attribute name="{@name}"> <xsl:value-of select="./action">
</xsl:value-of>
</xsl:attribute>
<tbody>
<tr>
<th><xsl:value-of select="./action">
</xsl:value-of></th>
</tr>
</tbody>
</xsl:if>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
作者: shanghuaipopu 发布时间: 2011-07-28
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28