title: xslt 2.0 : using HashMap
body: <p>i have a java method that returns a map to xslt.</p>
  
  <p>XSLT method call - </p>
  
  <pre><code>&lt;xsl:variable name="mapValue" select="class:returnMap()"&gt;
  </code></pre>
  
  <p>Java Method -</p>
  
  <pre><code>public Map&lt;String,List&lt;String&gt;&gt; returnMap(){
      Map&lt;String,List&lt;String&gt;&gt; map = new HashMap&lt;String,List&lt;String&gt;&gt;();
      List&lt;String&gt; list = new ArrayList&lt;String&gt;();
      list.add("1");
      list.add("2");
      map.put("a",list);
      map.put("b",list);
      return map
  }
  </code></pre>
  
  <p>how do I fetch the list value of the map in XSLT 2.0?
  i tried assigning the values to a variable using the below format,</p>
  
  <pre><code>&lt;xsl:variable name="valueOfA" select="$mapValue/entry[@key='a']"/&gt;
  &lt;xsl:variable name="valueOfB" select="$mapValue/entry[@key='b']"/&gt;
  </code></pre>
  
  <p>but, i got the below exception.</p>
  
  <pre><code>XPTY0019: Required item type of first operand of '/' is node(); supplied value has item type java:java.util.LinkedHashMap
  </code></pre>
  
  <p>if i try to display the value of $mapValue it prints fine.</p>