i want to use an external ruby function "w3ready " within an xsl ssheet
in order to transform a given text to unaccentuated.
calling the function :
<xsl:template match="/xCard">
[…]
<xsl:for-each select=“GRPS/GRP/*”>
<xsl:variable name=“group_label” select=“text()”/>
<xsl:variable name=“page_name”
select=“ex:w3ready($group_label)”/>
[…]
part of the xml :
AB2Web Amis [...] Santé Tourisme Vignerons 2.0 @uid company.png Négociant [...]the ruby function :
def w3ready( label )
puts “label = #{label}, label.class = #{label.class}”
s = “”
case( label.class.to_s )
when “Array”
s = label[ 0 ].u.www_ready
when “String”
s = label.u.www_ready
end
return s
end
i’m surprised here to get an Array instead of a String ( the reason for
the case when…)
#u.www_ready transforms “Maison de la Santé” into “maison_de_la_sante”
in order to build a file name.
the Array i get is of only one element…
where is my mistake here ?