• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

render string array in xslt

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a damn stupid question and still, thanks if anyone can just give the answer..

basically i am transforming an xml to html. But some additional info is passed as a string array to xslt as a param, the problem is how to process them in such a way that...

string array = {'a', 'b', 'c', 'd'}

xslt result:


[ December 10, 2006: Message edited by: Yi Meng ]
 
Marshal
Posts: 28174
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XSLT parameters are strings. They can't be arrays. So how are you passing this array?
 
Yi Meng
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Clapham:
XSLT parameters are strings. They can't be arrays. So how are you passing this array?


well, i am actually using xalan with the java ns as xmlns:java="java", so i can set java object as parameter such as resourcebundles as follows


and use them in xsl as follows,


so by default, i took that i can pass in parameter as a string array...and indeed yes.

The problem is that string array doesn't have methods, such as getString in ResourceBundle, to access it ....

Of course, i can write my own java extension to process the array, just as i did to format the date & time, but it's not preferred... i was just asking is there a xslt way to do this with just the java ns?

Thank you very much!
[ December 12, 2006: Message edited by: Yi Meng ]
 
Paul Clapham
Marshal
Posts: 28174
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then why not use an object that does have methods? Like for example make a List out of the array and pass that?
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic