xslt param with libxslt ....errr!

J

Jtzero 511

this one is driving me up a wall, I cant seem to pass a param to the
xslt what is wrong here? I keep getting nothingness...

<?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)


thank you,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top