【发布时间】:2011-07-26 09:30:54
【问题描述】:
我正在尝试创建 xaml Line 元素的 xsl 模板。
这是我目前所拥有的:
...
<xsl:call-template name="Line">
<xsl:with-param name="xOne" select="70"/>
<xsl:with-param name="xTwo" select="905"/>
<xsl:with-param name="yOne" select="500"/>
<xsl:with-param name="yTwo" select="500"/>
</xsl:call-template>
<xsl:template name="Line">
<xsl:param name="xOne"/>
<xsl:param name="xTwo"/>
<xsl:param name="yOne"/>
<xsl:param name="yTwo"/>
<Line xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Stroke="red"
StrokeThickness="2"
X1="$xOne"
X2="$xTwo"
Y1="<xsl:value-of select="number($yOne)"/>" <!-- example: not working -->
Y2="$yTwo"/>
</xsl:template>
问题:
- 有没有更好的方法来管理这些命名空间?
- 参数 $xOne、$xTwo、... 不起作用。据我所知,xslt 我应该像这样实现它们:
<xsl:value-of select="number($xOne)"/>但这是不可能的,因为我尝试实现它们的方式。
我希望有更多xslt和xaml经验的人可以帮助我? :)
我使用的是 xsl v1.0
提前。
【问题讨论】:
标签: xml xaml xslt namespaces