+ -
当前位置:首页 → 问答吧 → xsl:value-of取值问题

xsl:value-of取值问题

时间:2006-11-27

来源:互联网

XML里如果有标签
<tagname value="xxx">YYY</tagname>

用xsl:value-of取tagname的值是什么?
如果要取xxx用什么方法?\

谢谢!

[[i] 本帖最后由 astar 于 2006-11-30 16:38 编辑 [/i]]

作者: astar   发布时间: 2006-11-27

<xsl:value-of select="tagname/@value"/>

作者: syp3218   发布时间: 2006-11-29

谢谢楼上啊!
呵呵,刚接触XSL,觉得语法很诡异~~

作者: astar   发布时间: 2006-11-30

<select name="feature_select"  maxlength="80" onChange="javascript:funcSelectOther({ID})" id="feature_select{ID}"  onblur="doOnBlurOther('feature{ID}', {ISNEED_STR})" onFocus="doOnFocusOther('feature{ID}',{ISNEED_STR})" >
                                        <option value="">请选择</option>
                                        <xsl:for-each select="FEATUREVALUES/FEATUREVALUE">
                                        <xsl:variable name="featureValue"><xsl:value-of select="."/></xsl:variable>
                                        <xsl:choose>
                                            <xsl:when test = " $defaultValue =  $featureValue"  >
                                            <option selected = "true" value="{.}" ><xsl:value-of select="." /></option>
                                            </xsl:when>
                                            <xsl:otherwise>
                                            <option value="{.}"><xsl:value-of select="." /></option>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                        </xsl:for-each>
                                    </select>

作者: lok   发布时间: 2007-05-12