2013-03-11 76 views
0

我试图获取页面的文本字符串的值,为它分配一个URL,然后使用xslt在不同的页面上显示结果。我不确定如何获得文本字符串的值。Umbraco - 获取文本字符串值

这里是我的宏:

<!-- 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> 

回答

0

找到了! select="$parent/*[name() = $fieldName]