0

ページのテキスト文字列の値を取得し、それに URL を割り当て、xslt を使用して別のページに結果を表示しようとしています。テキスト文字列の値を取得する方法がわかりません。

これが私のマクロです:

    <!-- Input the related links property alias here -->
    <xsl:variable name="fieldName" select="/macro/fieldName"/>
    <xsl:template match="/">

        <xsl:if test="$fieldName != ''">
            <!-- The fun starts here -->

                        <xsl:element name="a">
                            <xsl:if test="./new-window[. = 'True']">
                                <xsl:attribute name="target">_blank</xsl:attribute>
                            </xsl:if>

                            <xsl:attribute name="href">
                                <xsl:value-of select="/myUrl.aspx"/>
                            </xsl:attribute>

                            <xsl:value-of select="./@title"/>
                        </xsl:element>

        </xsl:if>
    </xsl:template>

</xsl:stylesheet>
4

1 に答える 1

0

それを見つけた!select="$parent/*[name() = $fieldName]

于 2013-03-11T17:12:12.847 に答える