Xml 如何在xsl中检查字符串相等性(不区分大小写)
我需要检查Xml 如何在xsl中检查字符串相等性(不区分大小写),xml,xslt,xpath,Xml,Xslt,Xpath,我需要检查DB/@dbtype==“oracle”(不区分大小写)。我该怎么做? 这是我的密码 <xsl:choose> <xsl:when test="DB/@dbtype"> <p> <dd> <table border="1"> <tbody> <tr>
DB/@dbtype
==“oracle”(不区分大小写)。我该怎么做?
这是我的密码
<xsl:choose>
<xsl:when test="DB/@dbtype">
<p>
<dd>
<table border="1">
<tbody>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
<xsl:if test="DB/@dbtype='ORACLE'">
<xsl:for-each select="DB/oracle_props">
<tr>
<td valign="top" ><xsl:value-of select="@name"/></td>
<td valign="top" ><xsl:value-of select="@value"/></td>
</tr>
</xsl:for-each>
</xsl:if>
</tbody>
</table>
</dd>
</p>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="DB"/>
</xsl:otherwise>
</xsl:choose>
名称
价值
我想把它转换成所有的小写/大写,然后进行相应的检查,所以我在下面使用了
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="translate(product/@name, $smallcase, $uppercase)"/>
<!--It display in lower case, but how to use this in checking for equality?-->
请帮助我,如何比较字符串(不区分大小写)
东西
以同样的方式:
<xsl:if test="translate(DB/@dbtype, $smallcase, $uppercase) = 'ORACLE'">
如果您使用的是XSLT2.0+,那么您可以使用 i、 e
某物
<xsl:if test="translate(DB/@dbtype, $smallcase, $uppercase) = 'ORACLE'">
<xsl:if test="lower-case(product/@name)='oracle'">
something
</xsl:if>