C# 如何在C中从xml中获取数据到表中#
我有一个复选框,当我选中它并单击“继续”时,我想从xml文件中读取所有数据,并将其放入表中,其中一列显示超链接,这将帮助用户添加或编辑要保存或更新的数据 单选按钮代码:C# 如何在C中从xml中获取数据到表中#,c#,xml,xslt,active-objects,C#,Xml,Xslt,Active Objects,我有一个复选框,当我选中它并单击“继续”时,我想从xml文件中读取所有数据,并将其放入表中,其中一列显示超链接,这将帮助用户添加或编辑要保存或更新的数据 单选按钮代码: <input type="radio" value="Yes" id="RBServer" name="radio4">Server</td> 我已经创建了如下Server.XSLT文件 <?xml version="1.0" encoding="utf-8"?> <xsl:styl
<input type="radio" value="Yes" id="RBServer" name="radio4">Server</td>
我已经创建了如下Server.XSLT文件
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<html>
<body style="font-family:Helvetica Neue">
<Div id="ListingScreen1">
<table border="1" width="1024px" >
<tr>
<th>Server</th>
<th>ID</th>
</tr>
<xsl:choose>
<xsl:when test="CATALOG/orderByTitle">
<xsl:apply-templates select="CATALOG/CD">
<!--<xsl:sort select="TITLE" />-->
</xsl:apply-templates>
</xsl:when>
<xsl:when test="CATALOG/orderByTitleDesc">
<xsl:apply-templates select="CATALOG/CD">
<!--<xsl:sort select="TITLE" order="ascending" />-->
</xsl:apply-templates>
</xsl:when>
<xsl:when test="CATALOG/orderByArtist">
<xsl:apply-templates select="CATALOG/CD">
<!--<xsl:sort select="ARTIST" />-->
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</table>
</Div>
</body>
</html>
<!--<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>-->
</xsl:template>
<xsl:template match="CD">
<tr>
<td>
<!--<xsl:value-of select="ID"/>-->
</td>
<td onclick="javascript:FillEditScreen(this.innerText);">
<a href="javascript:void(0);">
<p style="display:none;">
<xsl:value-of select="Server"/>
</p>
<xsl:value-of select="ID"/>
</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
服务器
身份证件
我的xml文件是这样的:Server.xml
<?xml version="1.0" encoding="utf-8"?>
<CATALOG>
<orderByTitleDesc />
<CD>
<Server>KL12ACUC.CS.AD.KLMCORP.NET</Server>
<ID>KL12ACUC.CS.AD.KLMCORP.NET</ID>
</CD>
<CD>
<Server>basant112</Server>
<ID>basant</ID>
</CD>
</CATALOG>
KL12ACUC.CS.AD.KLMCORP.NET
KL12ACUC.CS.AD.KLMCORP.NET
basant112
巴桑特
您想读取xml并将其数据放入XSLT文件的表中,对吗?我想将数据插入显示为xml的表中。这样我就可以使用update再次编辑它
<?xml version="1.0" encoding="utf-8"?>
<CATALOG>
<orderByTitleDesc />
<CD>
<Server>KL12ACUC.CS.AD.KLMCORP.NET</Server>
<ID>KL12ACUC.CS.AD.KLMCORP.NET</ID>
</CD>
<CD>
<Server>basant112</Server>
<ID>basant</ID>
</CD>
</CATALOG>