Just curious if there is a cleaner, faster, better way of writing this
policy than what I have. A GCV list contains "name:IPAddress". The
policy loops through the GCV looking to match the NAME in the GCV with
the L attribute of the operation. If a match is found then the attribute
networkAddressRestriction is set, but it has to be base64 encoded and it
has to be with the noun "character" which can only pull from a variable,
not xpath.

Here's what I got.
<do-for-each>
<arg-node-set>
<token-global-variable name="networkAddressRestrictions"/>
</arg-node-set>
<arg-actions>
<do-trace-message level="3">
<arg-string>
<token-text xml:space="preserve">current-node:
</token-text>
<token-local-variable name="current-node"/>
</arg-string>
</do-trace-message>
<do-set-local-variable name="name-ipaddr" scope="policy">
<arg-node-set>
<token-split delimiter=":">
<token-local-variable name="current-node"/>
</token-split>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="school_name" scope="policy">
<arg-string>
<token-xpath expression="$name-ipaddr[1]"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-op-attr mode="nocase" name="L"
op="equal">$school_name$</if-op-attr>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="ipns" scope="policy">
<arg-node-set>
<token-split delimiter="\.">
<token-xpath expression="$name-ipaddr[2]"/>
</token-split>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="ip1" scope="policy">
<arg-object>
<token-xpath expression="$ipns[1]"/>
</arg-object>
</do-set-local-variable>
<do-set-local-variable name="ip2" scope="policy">
<arg-object>
<token-xpath expression="$ipns[2]"/>
</arg-object>
</do-set-local-variable>
<do-set-local-variable name="ip3" scope="policy">
<arg-object>
<token-xpath expression="$ipns[3]"/>
</arg-object>
</do-set-local-variable>
<do-set-local-variable name="ip4" scope="policy">
<arg-object>
<token-xpath expression="$ipns[4]"/>
</arg-object>
</do-set-local-variable>
<do-add-dest-attr-value name="Network Address
Restriction">
<arg-value type="structured">
<arg-component name="netAddrType">
<token-text
xml:space="preserve">1</token-text>
</arg-component>
<arg-component name="netAddr">
<token-base64-encode charset="ISO-8859-1">
<token-char value="$ip1$"/>
<token-char value="$ip2$"/>
<token-char value="$ip3$"/>
<token-char value="$ip4$"/>
</token-base64-encode>
</arg-component>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
<arg-actions/>
</do-if>
</arg-actions>
</do-for-each>


--
Jared Jennings
http://jaredjennings.org'
' (http://www.datatechnique.com)
------------------------------------------------------------------------
jaredljennings's Profile: http://forums.novell.com/member.php?userid=723
View this thread: http://forums.novell.com/showthread.php?t=427624