proper syntax for bpel bpel:doXslTransform

2019-07-23 11:41发布

I am trying to do an XSL transform on an xml structure in a bpel assignment statement. There is a syntax problem, but I am having trouble finding official documentation. There are examples all over the internet but I have not found a clear explanation. Here is my best shot. What do the last two parameters do? Why is eclipse saying the first argument must be a literal, even though test3.xsl is a string?

<bpel:assign validate="yes" name="Assign">
    <bpel:copy keepSrcElementName="no">
        <bpel:from>
            <![CDATA[bpel:doXslTransform("test3.xsl", $personalInfoServiceOutput.parameters), "middle", $positionSkillManagementInput]]>
        </bpel:from>
        <bpel:to variable="positionSkillManagementInput"></bpel:to>
    </bpel:copy>
</bpel:assign>

标签: bpel
3条回答
虎瘦雄心在
2楼-- · 2019-07-23 12:02

The signature of doXSLTransform looks as follows:

object bpel:doXslTransform(string, node-set, (string, object)*)

The first parameter is the name of the XSLT script, the second parameter is an XPath identifying the source document (e.g. a variable, part, nodeset, node). The third and the fourth parameter is a key-value pair, the string is the key and the object is the value. Those pairs are mapped into the script's parameter context so that you can access these values by their name in the script. There can be any number of these pairs.

The best resource to look up such things is the WS-BPEL 2.0 specification, doXSLTransform is described in Sect. 8.4

查看更多
男人必须洒脱
3楼-- · 2019-07-23 12:13

When I use the following code :

<bpel:copy keepSrcElementName="no">
<bpel:from>
<![CDATA[bpel:doXslTransform("parseSample.xsl", $output.payload)]]>
</bpel:from>
<bpel:to variable="output"></bpel:to>
</bpel:copy>

I also get the error, that first argument must be literal string.

But, when I deploy my service (with error) to wso2 bps, it works fine.

You can try with this.

查看更多
走好不送
4楼-- · 2019-07-23 12:24

I faced the same issue. Agree with NGoyal. Shows error in BPEL but works when deployed.

查看更多
登录 后发表回答