javascript 读取XML数据,在页面中展现、编辑、保存(2)


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="https://www.jb51.net/">
<html>
<header>
<title>table demo</title>
<script src="https://www.jb51.net/calendar.js" src="https://www.jb51.net/calendar.js" type="text/javascript"></script>
<script src="https://www.jb51.net/myjs.js" src="https://www.jb51.net/myjs.js" type="text/javascript"></script>
<link type="text/css" href="https://www.jb51.net/css/StyleSheet.css" href="https://www.jb51.net/css/StyleSheet.css" />
</header>
<body>
<form runat="server">
<div>
<input type="button" value="编辑"></input>
</div>
<xsl:for-each select="/Content/Table">
<table cellpadding="0" cellspacing="0">
<xsl:variable>
<xsl:value-of select="concat(@DefaultColumnWidth,'px')"/>
</xsl:variable>
<xsl:variable>
<xsl:value-of select="@DefaultRowHeight"/>
</xsl:variable>
<xsl:variable>
<xsl:value-of select="@ExpandedColumnCount"/>
</xsl:variable>
<xsl:variable>
<xsl:value-of select="@ExpandedRowCount"/>
</xsl:variable>
<xsl:for-each select="Row">
<tr>
<xsl:variable>
<xsl:choose>
<xsl:when test="position()=1">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:when test="position()!=1">
<xsl:value-of select="n "/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="Cell">
<td>
<xsl:attribute>
<xsl:choose>
<xsl:when test="@align!=''">
<xsl:value-of select="@align"/>
</xsl:when>
<xsl:when test="boolean('true')">center</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute>
<xsl:choose>
<xsl:when test="@Type='title'">title</xsl:when>
<xsl:when test="@Type='header'">header</xsl:when>
<xsl:when test="@Type='content'">content</xsl:when>
<xsl:when test="boolean('true')">other</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:if test="position()=1">
<xsl:attribute>
<xsl:value-of select="$height"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$oncetime=1 and @MergeDown=''">
<xsl:attribute>
<xsl:value-of select="$width"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@MergeDown!=''">
<xsl:attribute>
<xsl:value-of select="@MergeDown"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@MergeAcross!=''">
<xsl:attribute>
<xsl:value-of select="@MergeAcross"/>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="Data/text()"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


编辑页的xsl

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjyzwx.html