U
Une Bévue
I'm trying to pass one parameter to XSLT Transform, like that :
doc = Nokogiri::XML(File.read(find_latest_xml))
xslt = Nokogiri::XSLT(File.read("#{@sites_xml_fo}/#{@xsl_fbn}"))
puts xslt.transform(doc, ["lang", "fr"])
with the following styyle sheet :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
....
<xslaram name="lang"/>
....
<h2>$lang = <xsl:value-of select="$lang"/></h2>
resulting in :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h2>My Family Address Book</h2>
<h2>$lang = </h2>
that's to say the parameter is seen as empty, why ???
also, i'd like to pas more parameters, is it like that :
puts xslt.transform(doc, ["param-1", "value-1", ..., "param-n",
"value-n"])
???
doc = Nokogiri::XML(File.read(find_latest_xml))
xslt = Nokogiri::XSLT(File.read("#{@sites_xml_fo}/#{@xsl_fbn}"))
puts xslt.transform(doc, ["lang", "fr"])
with the following styyle sheet :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
....
<xslaram name="lang"/>
....
<h2>$lang = <xsl:value-of select="$lang"/></h2>
resulting in :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<h2>My Family Address Book</h2>
<h2>$lang = </h2>
that's to say the parameter is seen as empty, why ???
also, i'd like to pas more parameters, is it like that :
puts xslt.transform(doc, ["param-1", "value-1", ..., "param-n",
"value-n"])
???