Xpath syntax to read all attributes in a generated query

Hi,

I'm again ask help to XPATH expert to get information from an XML query.

The source XML/XDS  is a query generated by the REST driver :

<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product build="20181130_1107" instance="Rest Driver" version="1.0.2.0">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<input>
<query class-name="User">
<search-class class-name="User"/>
<search-attr attr-name="cn ">
<value> *bla</value>
</search-attr>
<read-attr attr-name="CN "/>
<read-attr attr-name=" Surname "/>
<read-attr attr-name=" Given Name "/>
<read-attr attr-name=" Internet Email Address"/>
</query>
</input>
</nds>

 

And I need to get each queried attribute to make some condition, I did that :

<rule>
<description>Check query content - idsa 16 sept 2019</description>
<conditions>
<and>
<if-operation mode="nocase" op="equal">query</if-operation>
<if-xpath op="true">@class-name="User"</if-xpath>
</and>
</conditions>
<actions>
<do-set-local-variable name="ReadAttrName" scope="policy">
<arg-node-set>
<token-xpath expression="$current-op/read-attr/@attr-name[last()]"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-xpath expression="$current-node/read-attr/@attr-name"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="attrvalue" scope="policy">
<arg-node-set>
<token-xpath expression="$current-value"/>
</arg-node-set>
</do-set-local-variable>
</arg-actions>
</do-for-each>
</actions>
</rule>

I can see all attributes in the local variable ReadAttrName, but the "for each" does not give any value.

 

Any help ?

 

Thanks a lot.

 

Sylvain