我的XML貌似这个我想他的名字是data.xml中如何检查复选框如果XML值是肯定的,如果没有选中比
<?xml version="1.0" standalone="yes"?>
<CATALOG>
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<CD />
<CD>
<ID>1</ID>
<LocationID>wqe</LocationID>
<ChangeValueFor>qwe</ChangeValueFor>
<Banner>wew</Banner>
<DataEntry>Yes</DataEntry>
<LocalView>No</LocalView>
<Export>Yes</Export>
<View>qwe</View>
<ActiveView>wqe</ActiveView>
<HelpFile>qwe`qw</HelpFile>
<Location01>qwe</Location01>
<Location02>eq</Location02>
<Location03>we</Location03>
<Location04>wqew</Location04>
<Location05>qws</Location05>
<Location06>sds</Location06>
<Location07>wde</Location07>
<Location08>sd</Location08>
<Location09>sad</Location09>
<Server>31 March 2014 testing with font</Server>
<Server2>171.21.102.11</Server2>
<Server3>171.21.102.11</Server3>
<CodeBase>CodeBase2</CodeBase>
<CodeBase2>ZaidiTest</CodeBase2>
<CodeBase3>test222</CodeBase3>
<ClassiscID>ClassID312131313</ClassiscID>
<ClassiscID2>31 amrch testing for font</ClassiscID2>
<ClassiscID3>ClassID2</ClassiscID3>
<Theme>VashnoDevi</Theme>
<Theme2>class</Theme2>
<Theme3>class</Theme3>
<Theme4>Theme2</Theme4>
<Theme5>Ser</Theme5>
<Theme6>Themes1test</Theme6>
</CD>
时<DataEntry>
<LocalView>
和<Export>
是肯定比我的支票盒子是Y检查,并保持否比未选中(原样)。
我的XSLT文件如下: 我只是想只在数据录入只添加一个复选框,请告诉我,我做的错误
Myxslt文件如下:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<body style="font-family:Helvetica Neue">
<!--<Div id="ListingScreen" style="display:Yes;">-->
<Div id="ListingScreen">
<table border="1" width="1024px" >
<tr bgcolor="blue">
<FONT
style="BACKGROUND-COLOR: #0000ff">
<FONT color="white">
<STRONG>
Maintenance of Parameters for Cube Access
</STRONG>
</FONT>
</FONT>
</tr>
<tr>
<td align="right" colspan="8">
<img src="http://localhost:51242/Images/AFKLLogo.png" alt="Smiley face" width="210"></img>
</td>
</tr>
<tr>
<td colspan="8">
<h1>WPTesting - Cube List Web Part</h1>
</td>
</tr>
<tr>
<td colspan="8" align="center">
<input type="Button" id="btnAddMasterData" value="Add Master Data" onclick="javascript:AddMasterData()"/>
<input type="Button" id="btnAdd" value=" Add " onclick="javascript:location.href='AddMaster.aspx'"/>
</td>
</tr>
<tr>
<th id="location">Location ID</th>
<th>Data Entry</th>
<th>Export</th>
<th>Local View</th>
<th>Banner</th>
<th>Server</th>
<th>View</th>
<th>Locl</th>
</tr>
<xsl:choose>
<xsl:when test="CATALOG/orderByTitle">
<xsl:for-each select="CATALOG/CD" order-by="+ TITLE">
<tr>
<td onclick="javascript:FillEditScreen(this.innerText);">
<a href="javascript:void(0);">
<p style="display:none;">
<xsl:value-of select="ID"/>
</p>
<xsl:value-of select="LocationID"/>
</a>
<input type="checkbox" id="chkdataentry" />
<xsl:value-of select='DataEntry'/>
</td>
<td>
<input type="checkbox" id="chkLocalView" />
<xsl:value-of select='LocalView'/>
</td>
<td>
<input type="checkbox" id="chkExport"/>
<xsl:value-of select='Export'/>
</td>
<td>
<xsl:value-of select="Banner"/>
</td>
<td>
<xsl:value-of select="Server"/>
</td>
<td>
<xsl:value-of select="View"/>
</td>
<td>
<xsl:value-of select="Location01"/>
</td>
</tr>
</xsl:for-each>
</xsl:when>
<xsl:when test="CATALOG/orderByTitleDesc">
<xsl:for-each select="CATALOG/CD" order-by="- TITLE">
<tr>
<td onclick="javascript:FillEditScreen(this.innerText);">
<a href="javascript:void(0);">
<p style="display:none;">
<xsl:value-of select="ID"/>
</p>
<xsl:value-of select="LocationID"/>
</a>
</td>
<input type="checkbox" name="DataEntry" value="Milk">
<xsl:if test="CATALOG/CD='Yes'">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
<!--<td>
<input type="checkbox" checked="true" id="chk" value="Milk"/>
</td>-->
<td>
<input type="checkbox" checked="true" name="Export" value="export"/>
</td>
<td>
<input type="checkbox" checked="true" name="LocalView" value="export"/>
</td>
<td>
<xsl:value-of select="Banner"/>
</td>
<td>
<xsl:value-of select="Server"/>
</td>
<td>
<xsl:value-of select="View"/>
</td>
<td>
<xsl:value-of select="Location01"/>
</td>
</tr>
</xsl:for-each>
</xsl:when>
<xsl:when test="CATALOG/orderByArtist">
<xsl:for-each select="CATALOG/CD" order-by="+ ARTIST">
<tr bgcolor="blue">
<td>
<input type="Button" id="btnArtist" value="Impala"/>
</td>
<td>
<input type="checkbox" id="chk" value="Milk"/>
</td>
<td>
<input type="checkbox" name="Export" value="export"/>
</td>
<td>
<input type="checkbox" checked="true" name="LocalView" value="export"/>
</td>
<td>
<xsl:value-of select="Banner"/>
</td>
<td>
<xsl:value-of select="Server"/>
</td>
<td>
<xsl:value-of select="View"/>
</td>
<td>
<xsl:value-of select="Locl"/>
</td>
</tr>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</table>
</Div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
的主要代码是这样变薄,但它给我的错误不知道为什么
<input type="checkbox" name="DataEntry" value="Milk">
<xsl:if test="CATALOG/CD='Yes'">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
其工作要命添谢谢你一吨... –