Access DOM attribute with XML namespace on Freemarker template
<p>I have the following XML.</p>

<pre><code>&lt;n:wmi xmlns:inventory="http://www.example.com/XMLSchema/mp/v1/item/ItemInventory.xsd" &gt;
&lt;items processMode="INCREMENTAL"&gt;
  &lt;item partnerItemId="SM-290754-US"&gt;
    &lt;action&gt;UPDATE&lt;/action&gt;
    &lt;inventory:availability code="AC" onHandQty="124" /&gt;
  &lt;/item&gt;
&lt;/items&gt;
</code></pre>

<p>  </p>

<p>I want to access the "code" attribute in Freemarker template. Following is my freemarker template.</p>

<p>I tried the following templates. But none of them are working.</p>

<pre><code>&lt;#ftl ns_prefixes={"inventory":"http://www.example.com/XMLSchema/mp/v1/item/ItemInventory.xsd"}&gt;${item["inventory:availability[@code]"]}
</code></pre>

<p>and </p>

<pre><code>&lt;#ftl ns_prefixes={"inventory":"http://www.example.com/XMLSchema/mp/v1/item/ItemInventory.xsd"}&gt;${item["inventory:availability.@code"]}
</code></pre>