【发布时间】:2010-05-26 06:51:28
【问题描述】:
假设我有一个如下的 XSL:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="sortKey" select="'firstname'"/>
</xsl:stylesheet>
然后一个XML如下
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="XYZ.xsl"?>
<ABC>
<firstname>GREG</firstname>
</ABC>
我想从 XML 向 XSL 参数 firstname 传递一个值。我可以这样做吗?如果是,如何?
从答案看来这是不可能的。
如何从同一个 XML 中读取值并将其分配给参数。这可以做到吗?如果是,怎么做?
【问题讨论】:
-
但是如果你已经有了 XML 中的数据,为什么还要使用参数呢?