title: Arrays with java XSLT Extensions
body: <p>I'm trying to use arrays in XSLT Extensions using java .</p>
  
  <p>I'm getting the below error :</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: org.apache.xpath.objects.XObject 
                       cannot be cast to org.apache.xpath.objects.XNodeSet.
  </code></pre>
  
  <p>The way I used arrays is. An extension class method</p>
  
  <pre><code>public static String[] getEvents(String contractIdStr,String tradeIdStr) {
      return new String[]{"MacroType","Type","SubType"};
  }
  </code></pre>
  
  <p>Inside XSL , </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" 
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:partyrefrule="com.converter.Rules" 
   exclude-result-prefixes="partyrefrule"&gt;
  
      &lt;xsl:variable name="vLastNegoTradeEvents"&gt;
          &lt;xsl:value-of select="partyrefrule:getEvents($cVal,$tVal)"/&gt;
      &lt;/xsl:variable&gt;
  
      &lt;xsl:message terminate="no"&gt;
          &lt;xsl:value-of select="$vLastNegoTradeEvents[0]"/&gt;
      &lt;/xsl:message&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I'm using XALAN Parse for this.</p>