私はこのコードを持っています:
<a>
<xsl:attribute name="href">
<xsl:value-of select="$foo"/>
</xsl:attribute>
bar
</a>
問題は私が得る変換後です:
<a href="
 PooValue 
" >bar</a>
私のxsl:outputはindent="no"です。
VisualStudioはすべてのファイルをインデントします。したがって、コードを1行の作業に入れますが
<a><xsl:attribute name="href"><xsl:value-of select="$foo"/></xsl:attribute>bar</a>
最初はあまり読みにくく、VSはインデントを変更するので、別の解決策が必要です。すこし :
<xsl:attribute name="href" select="concat(mystuff)" />
しかし、それは存在せず、また非常に読みやすくはありません。
他の解決策は次のとおりです。
<a href="{$foo}" >bar</a>
しかし、どうすればこれで以下のようなxsl処理を使用できますか?
<a>
<xsl:attribute name="href">
<xsl:choose >
<xsl:when test="$atest">
<xsl:value-of select="$foo"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$foo2"/>
</xsl:otherwise>
</xsl:choose >
</xsl:attribute>
bar
</a>
使用:
<xsl:value-of select="normalize-space($foo)"/>
効果はありません原因:との間に


作成されます
<xsl:attribute name="href">
<xsl:value-of select="normalize-space($foo)"/>
私はxslt 1.0
C# .net 4
一緒に働きますXslCompiledTransform
詳細:XslCompiledTransformの結果を