Calling java.util.Arrays.asList() won't work
Added by Anonymous almost 20 years ago
Legacy ID: #2869146 Legacy Poster: James Francis Cerra (quantum_jim)
As a test, I tried directly using java.util.Arrays.asList() from saxon: <xsl:for-each select='Arrays:asList("Larry", "Moe", "Curly")' xmlns:Arrays="java:java.util.Arrays" > <xsl:value-of select="." /> </xsl:for-each> However, that doesn't work; I get a error message: Cannot find a matching 3-argument function named {java:java.util.Arrays}asList() Transformation failed: Run-time errors were reported According to Sun's Javadocs, this should work. Does anyone konw why it doesn't work? (And yes, this is a trivial problem to workaround - it was only a test).
Replies (2)
RE: Calling java.util.Arrays.asList() won't w - Added by Anonymous almost 20 years ago
Legacy ID: #2869570 Legacy Poster: Michael Kay (mhkay)
The asList() expects a single argument, but you have called it with three arguments. Try passing a single sequence-valued argument: Arrays:asList(("Larry", "Moe", "Curly")) (not tested) Michael Kay
RE: Calling java.util.Arrays.asList() won't w - Added by Anonymous almost 20 years ago
Legacy ID: #2870226 Legacy Poster: James Francis Cerra (quantum_jim)
That worked. (Odd, since the example was based on the JavaDocs.) Thanks.
Please register to reply