我正在将一个param值传递到XSLT中。稍后,我想在我的节点属性中打印param值。有人能帮我吗?
下面是我尝试使用的XSLT代码-
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
xmlns:wd="urn:com.workday.report/CR_Course_Registration_Records_-_GETA"
version="1.0">
<xsl:param name="StuName"/>
<xsl:template match="/">
<wd:Report_Entry>
<wd:Student wd:Descriptor="$StuName1">
</wd:Student>
</wd:Report_Entry>
</xsl:template>
</xsl:stylesheet>
您需要将变量引用封装在大括号中。
<wd:Student wd:Descriptor="{$StuName1}">
使用属性值模板<wd:Student wd:Descriptor="{$StuName1}">...</wd:Student>
。