Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > xml/xslt external function

Thread Tools

xml/xslt external function

Une Bévue
Posts: n/a

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"

part of the xml :


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
return s

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 ?
Une Bévue
Reply With Quote
Tim Perrett
Posts: n/a
What XSLT parser are you using?
Ive just done a load of XSLT work and im not sure this is possible??


Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
a member function call an external function with same name C++ 1 02-09-2007 04:19 PM
a member function call an external function with same name C++ 0 02-09-2007 04:14 PM
inner function calling external function John Smith Javascript 0 03-17-2005 06:10 PM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
unresolved external symbol/using an external dll Scott Allen C++ 8 05-02-2004 06:11 PM