2017-02-23 12 views
0

を含めることはできませんが、エラーXSLです:アンカータグでhref価値を創造しながら、テキストは子要素を含めることはできませんが、それはここのxsl:テキスト私は取得しています子要素

を作成n0tある.here私のコードは http://xsltransform.net/bwdwsLです

<a><xsl:attribute name="href"> 
        <xsl:text>http://m.timesofindia.com?upcahe=<xsl:value-of select="'dd'"/></xsl:text> 
      </xsl:attribute>Next</a> 
+0

外部リンクではなく、質問内に必要なコードをすべて投稿してください。 –

答えて

1

あなたの属性値は完全に静的であるため、単純にリテラル属性を使用できます

<a href="http://m.timesofindia.com?upcahe=dd">Next</a> 

あなたは、XPathを使用して属性値の一部を計算したい場合は、attribute value templates例えばを使用します

<a href="http://m.timesofindia.com?upcahe={'dd'}">Next</a> 

あなたは本当に

<xsl:attribute name="href">http://m.timesofindia.com?upcahe=<xsl:value-of select="'dd'"/></xsl:attribute> 

またはxsl:text

<xsl:attribute name="href"> 
    <xsl:text>http://m.timesofindia.com?upcahe=</xsl:text> 
    <xsl:value-of select="'dd'"/> 
</xsl:attribute> 
再び

、場合にのみ意味をなすものすべてと、その後xsl:attributeを使用する必要がある場合は、XML文書から、あなたのXPath式選択データ静的な文字列ではありません。

関連する問題