aspose file tools*
The moose likes XML and Related Technologies and the fly likes render string array in xslt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "render string array in xslt" Watch "render string array in xslt" New topic
Author

render string array in xslt

Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
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 ]

Meng Yi
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

XSLT parameters are strings. They can't be arrays. So how are you passing this array?
Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Then why not use an object that does have methods? Like for example make a List out of the array and pass that?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: render string array in xslt