As Arif points out, you must use a call action. What you could do is have your xsl store the name of the rule to call in a context variable. You could also have your xsl output something simple such as

<condition><call>true</call></conditional>

You could then have a conditional action use that as input and only reference a call action if the input context of /condition/call = 'true', and your call action would reference the context variable that has the name of the rule you wish to call.
I am struggling to get clarity of this approach. Any help is appreciated. An XSL snippet that achieves this objective would be great.

I have to go through this approach as 'dp:decode' throws me a Non-UTF error while base-64 decoding the attachments. HermannSW on DW in some post wrote he has a solution.. for UTF-8 error.. using ffd that approach with a enough detail is acceptable as well.

Re: For-each X-path node How to call a processing rule

‏2012-10-30T13:54:41Z

This is the accepted answer.
This is the accepted answer.

The referenced post was for a conditional action, and this question was for a for-each action. In the case of a for-each that does a call action would specify your called rule (I'd assume you'd be calling the same rule for each of your three attachments). In your for-each, specify the xpath /root/EmailMsg/attachment that has a referenced call action that specifies your called rule. In that called rule, var://service/multistep/loop-iterator will have the attachment nodeset that matched the xpath. I suppose my question is what do you want to do with this attachment? If you are needing to do a transformation, then having a stylesheet using xsl:apply-templates with a template match on the attachment node would be a better approach.

Re: For-each X-path node How to call a processing rule

The referenced post was for a conditional action, and this question was for a for-each action. In the case of a for-each that does a call action would specify your called rule (I'd assume you'd be calling the same rule for each of your three attachments). In your for-each, specify the xpath /root/EmailMsg/attachment that has a referenced call action that specifies your called rule. In that called rule, var://service/multistep/loop-iterator will have the attachment nodeset that matched the xpath. I suppose my question is what do you want to do with this attachment? If you are needing to do a transformation, then having a stylesheet using xsl:apply-templates with a template match on the attachment node would be a better approach.

I want to just base-64 decode the the attachment and send it to the back-end. But, As I informed before using dp:decode throws a Non-UTF-8 error.

I am trying to not use that function and create a context and POST to it using dp:url-open target attachment://context/xyz/cid:xyz and next with results action containing 'attachment://context/xyz/cid:xyz?Decode=base64 ' ==> OUTPUT which is working...

Now I wanna iterate on this working processing rule for all my attachments.

Re: For-each X-path node How to call a processing rule

I want to just base-64 decode the the attachment and send it to the back-end. But, As I informed before using dp:decode throws a Non-UTF-8 error.

I am trying to not use that function and create a context and POST to it using dp:url-open target attachment://context/xyz/cid:xyz and next with results action containing 'attachment://context/xyz/cid:xyz?Decode=base64 ' ==> OUTPUT which is working...

Now I wanna iterate on this working processing rule for all my attachments.

It seems that what you want to do is a transformation action where the stylesheet is doing an identity like transformation using apply-templates. On your template match for "attachment", you'd do something like:

So essentially, you transform the attachment node, replacing the content with the xop:Include node. You may need to create a uuid for the "uniquecontent" part of the id. Then the url-open would be used to write the attachment. The iteration would be handled by the apply-templates of the stylesheet.

Regards,
Steve

It seems that what you want to do is a transformation action where the stylesheet is doing an identity like transformation using apply-templates. On your template match for "attachment", you'd do something like:

So essentially, you transform the attachment node, replacing the content with the xop:Include node. You may need to create a uuid for the "uniquecontent" part of the id. Then the url-open would be used to write the attachment. The iteration would be handled by the apply-templates of the stylesheet.

Re: For-each X-path node How to call a processing rule

It seems that what you want to do is a transformation action where the stylesheet is doing an identity like transformation using apply-templates. On your template match for "attachment", you'd do something like:

So essentially, you transform the attachment node, replacing the content with the xop:Include node. You may need to create a uuid for the "uniquecontent" part of the id. Then the url-open would be used to write the attachment. The iteration would be handled by the apply-templates of the stylesheet.

Re: For-each X-path node How to call a processing rule

It seems that what you want to do is a transformation action where the stylesheet is doing an identity like transformation using apply-templates. On your template match for "attachment", you'd do something like:

So essentially, you transform the attachment node, replacing the content with the xop:Include node. You may need to create a uuid for the "uniquecontent" part of the id. Then the url-open would be used to write the attachment. The iteration would be handled by the apply-templates of the stylesheet.