Removing Selected Source Attributes
Novell Cool Solutions: Tip
|
Digg This -
Slashdot This
Posted: 15 Dec 2005 |
Problem
I am attempting to remove source attributes that are stored in a schema syntax of "PATH" (structured attribute). I want to remove all attributes that are of a specific "volume". Is this possible?Solution
Here's some advice from the Forum's Father Ramon:
You would need to do the following:
- Read all the values of the attribute.
- Narrow that down to the set you want to remove. ,
- Send a remove value for those values.
For example:
<do-set-local-variable name="sourceValues">
<arg-node-set>
<token-src-attr name="Home Directory"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-xpath expression="$sourceValues[component[@name='volume'] =
'\mytree\myorg\myvolume']"/>
</arg-node-set>
<arg-actions>
<do-remove-src-attr-value name="Home Directory">
<arg-value type="structured">
<arg-component name="nameSpace">
<token-xpath expression="$current-node/component[@name='nameSpace']"/>
</arg-component>
<arg-component name="volume">
<token-xpath expression="$current-node/component[@name='volume']"/>
</arg-component>
<arg-component name="path">
<token-xpath expression="$current-node/component[@name='path']"/>
</arg-component>
</arg-value>
</do-remove-src-attr-value>
</arg-actions>
</do-for-each>
Here's an XPATH expression for a given volume and path:
$sourceValues[(component[@name='volume'] = '\mytree\myorg\myvolume') and ([component[@name='path'] = '\mytree\myorg\myvolume')]
... and one for a given volume and a path starting with "xxxx" ...
$sourceValues[(component[@name='volume'] = '\mytree\myorg\myvolume') and starts-with(component[@name='path'],'xxxx')]
... or a given volume and a path that contains "xxxx" ...
$sourceValues[(component[@name='volume'] = '\mytree\myorg\myvolume') and contains(component[@name='path'],'xxxx')]
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

