Hi,

I'm pushing Facsimile Telephone Number out to a oracle table its appending
the bit rate etc. I've found some code on the interweb that supposedly
strips the relevant details out but its not working for me. I'm using IDM2
on eDir 8.7.3.9. Here's the rule XML:-

<description>Facsimile Telephone Number reformat</description>
<conditions>
<and>
<if-attr name="Facsimile Telephone Number" op="available"/>
</and>
</conditions>
<actions>
<do-clone-xpath dest-expression=".." src-expression="$query1"/>
<do-set-local-variable name="instance">
<arg-node-set>
<token-xpath expression="../instance[last()]"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-xpath expression="$instance/attr[@attr-name = 'Facsimile
Telephone Number']/value"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="faxnum">
<arg-string>
<token-xpath
expression="$current-node/component[@name='faxNumber']"/>
</arg-string>
</do-set-local-variable>
<do-strip-xpath expression="$current-node/node()"/>
<do-set-local-variable name="temp">
<arg-string>
<token-xpath
expression="$current-node/component[@name='faxNumber']"/>
</arg-string>
</do-set-local-variable>
<do-append-xml-text expression="$current-node">
<arg-string>
<token-local-variable name="faxnum"/>
</arg-string>
</do-append-xml-text>
<do-set-xml-attr expression="$current-node" name="type">
<arg-string>
<token-text>string</token-text>
</arg-string>
</do-set-xml-attr>
</arg-actions>
</do-for-each>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">Output of Facsimile Telephone
Number:</token-text>
<token-xpath expression="$instance/attr[@attr-name = 'Facsimile
Telephone Number']/value"/>
</arg-string>
</do-trace-message>
<do-append-xml-element expression="$instance" name="attr"/>
<do-set-xml-attr expression="$instance/attr[last()]" name="attr-name">
<arg-string>
<token-text xml:space="preserve">action</token-text>
</arg-string>
</do-set-xml-attr>
<do-append-xml-element expression="$instance/attr[last()]" name="value"/>
<do-set-xml-attr expression="$instance/attr[last()]/value" name="type">
<arg-string>
<token-text xml:space="preserve">string</token-text>
</arg-string>
</do-set-xml-attr>
<do-append-xml-text expression="$instance/attr[last()]/value">
<arg-string>
<token-text xml:space="preserve">D</token-text>
</arg-string>
</do-append-xml-text>
<do-strip-xpath expression="../modify"/>
<do-break/>
</actions>

And here's the trace:-

11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: (if-attr 'Facsimile Telephone
Number' available) = TRUE.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Rule selected.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Applying rule 'Facsimile Telephone
Number reformat'.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-clone-xpath(dest-expression="..",src-expression="$query1").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-set-local-variable("instance",arg-node-set(token-xpath("../instance[last()]"))).
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:
arg-node-set(token-xpath("../instance[last()]"))
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: token-xpath("../instance[last()]")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Token Value: {}.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: {}.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-for-each(arg-node-set(token-xpath("$instance/attr[@attr-name = 'Facsimile
Telephone
Number']/value")),arg-actions(do-set-local-variable("faxnum",token-xpath("$current-node/component[@name='faxNumber']")),do-strip-xpath("$current-node/node()"),do-set-local-variable("temp",token-xpath("$current-node/component[@name='faxNumber']")),do-append-xml-text("$current-node",token-local-variable("faxnum")),do-set-xml-attr("type","$current-node","string"))).
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:
arg-node-set(token-xpath("$instance/attr[@attr-name = 'Facsimile Telephone
Number']/value"))
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:
token-xpath("$instance/attr[@attr-name = 'Facsimile Telephone
Number']/value")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Token Value: {}.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: {}.
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:
arg-actions(do-set-local-variable("faxnum",token-xpath("$current-node/component[@name='faxNumber']")),do-strip-xpath("$current-node/node()"),do-set-local-variable("temp",token-xpath("$current-node/component[@name='faxNumber']")),do-append-xml-text("$current-node",token-local-variable("faxnum")),do-set-xml-attr("type","$current-node","string"))
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action: do-trace-message("Output
of Facsimile Telephone Number:"+token-xpath("$instance/attr[@attr-name =
'Facsimile Telephone Number']/value")).
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: arg-string("Output of Facsimile
Telephone Number:"+token-xpath("$instance/attr[@attr-name = 'Facsimile
Telephone Number']/value"))
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: token-text("Output of Facsimile
Telephone Number:")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:
token-xpath("$instance/attr[@attr-name = 'Facsimile Telephone
Number']/value")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Token Value: "".
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: "Output of Facsimile
Telephone Number:".
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Output of Facsimile Telephone
Number:
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-append-xml-element("attr","$instance").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-set-xml-attr("attr-name","$instance/attr[last()]","action").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: arg-string("action")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: token-text("action")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: "action".
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-append-xml-element("value","$instance/attr[last()]").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-set-xml-attr("type","$instance/attr[last()]/value","string").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: arg-string("string")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: token-text("string")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: "string".
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-append-xml-text("$instance/attr[last()]/value","D").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: arg-string("D")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: token-text("D")
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Arg Value: "D".
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action:
do-strip-xpath("../modify").
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Action: do-break().
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST: Policy returned:
11:50:12 5B580BB0 Drvrs: KDS_LMS_EMPL ST:

Am I missing something? Will this code work with IDM2?

Thanks in advance,

Matt