我需要幫助。 我在一個名爲file_a.xsl
的XSLT文件中定義了javascript。 我還有另一個名爲file_b.xslt
的XSLT文件。 我一直在努力致電file_a.xsl
中定義的sayHello()
功能。從包含在主xslt文件中的外部xslt文件調用javascript函數
她是file_a.xsl
:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:foo="http://www.cateringportal.com/"
extension-element-prefixes="msxsl">
<msxsl:script language="javascript" implements-prefix="foo">
<![CDATA[
function sayHello()
{
return "hello there";
}
]]>
</msxsl:script>
</xsl:stylesheet>
她是file_b.xsl
:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="http://www.cateringportal.com/" >
<xsl:include href="helloXSL.xsl" />
<xsl:output method="html"/>
<xsl:template match="/">
<br/>
<xsl:value-of select="foo:sayHello()」/>
</xsl:template>
</xsl:stylesheet>
我將竭誠爲解決此問題的幫助。