Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

render string array in xslt

 
Yi Meng
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • 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 ]
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic