开发者

how to add a param to xslt with xslt-ruby?

the title states it, essentially what is wrong here? I keep getting nothingness the 开发者_运维百科param isnt getting passed...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:param name="stylesheet"/>

  <xsl:template match="/">
    <xsl:copy-of select="$stylesheet"/>
  </xsl:template>
</xsl:stylesheet>

and heres the ruby code

require "rubygems"

require 'xml'
require 'libxml'
require 'libxslt'

xsltdoc = XML::Document.file("main.xslt")
xslt = LibXSLT::XSLT::Stylesheet.new(xsltdoc)

xml = XML::Document.file("file.xml")
result = xslt.apply(xml, {:stylesheet => "style.css"})
puts(result)


turns out it had something to do with xslt processor, ran it through a saxon soap service and it worked

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜