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


<?xml version="1.0" encoding="utf-16"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="https://www.jb51.net/">
<html>
<head>
<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" />
</head>
<body>
<form method="post">
<div>
<div>
<input type="button" runat="server" value="保存"></input>
<input type="button" runat="server" value="取消"></input>
</div>
<table cellpadding="0" cellspacing="0">
<xsl:for-each select="Content/Table">
<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:value-of select="'adminth'"/>
</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: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:for-each select="Data">
<xsl:choose>
<xsl:when test="@IsEdit='1' and @Type='String'">
<input type="text">
<xsl:attribute>
<xsl:value-of select="text()"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',$width)"/>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when test="@IsEdit='1' and @Type='Date'">
<input type="text">
<xsl:attribute>
<xsl:value-of select="text()"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',concat(string(number(translate($width,'px',''))+30),'px'))"/>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when test="@IsEdit='1' and @Type='Number'">
<input type="text">
<xsl:attribute>
<xsl:value-of select="text()"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',$width)"/>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when test="@IsEdit='1' and @Type='Double'">
<input type="text">
<xsl:attribute>
<xsl:value-of select="text()"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',$width)"/>
</xsl:attribute>
</input>
</xsl:when>
<xsl:when test="@IsEdit='1' and @Type='Combox'">
<select>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat(concat(@id,'</p><p><br></p>),concat(@DataSource,'</p><p><br></p>),concat(text(),'</p><p><br></p>))"></xsl:value-of>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',$width)"/>
</xsl:attribute>
</select>
</xsl:when>
<xsl:when test="boolean('true')">
<span>
<xsl:value-of select="text()"/>
<xsl:attribute>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute>
<xsl:value-of select="concat('width:',$width)"/>
</xsl:attribute>
</span>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</div>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


ajax实现得到数据集的ashx代码

复制代码 代码如下:

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

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