0

リクエストxmlは次のとおりです。

<ABC>
 <ServiceCharacteristic>
     <Code>AAA</Code>
     <CharacteristicValue>
       <CharacteristicValue>2222</CharacteristicValue>
     </CharacteristicValue>
 </ServiceCharacteristic>

 <ServiceCharacteristic>
     <Code>BBB</Code>
     <CharacteristicValue>
       <CharacteristicValue>2223</CharacteristicValue>
     </CharacteristicValue>
 </ServiceCharacteristic>

 <ServiceCharacteristic>
     <Code>CCC</Code>
     <CharacteristicValue>
       <CharacteristicValue>2224</CharacteristicValue>
     </CharacteristicValue>
   </ServiceCharacteristic>
 <Account>
 --------
 </Account>

</ABC>


Need to put a BPEL if condition to check if there is ServiceCharacteristic with code   "CCC"

以下のようなことを試しましたが、うまくいきませんでした(Error(703): The LocationPath expression "self::node()/child::*[(local-name() = "Code")]" is not allowed in as there is no暗黙のコンテキスト ノードが存在する):

**count($variable name/'*asterisk'[local-name()='ServiceCharacteristic' and     ./'*asterisk'[local-name()='Code']='CCC'] ) > 0**

入力してください..ありがとう

4

1 に答える 1

0

I pasted your XML script as presented in the question into an XPath evaluator and the following expresssion returns true for me:

count(/*[local-name() = 'ABC']/*[local-name() = 'ServiceCharacteristic']/*[local-name() = 'Code' and text() = 'CCC'])>0

Using that in a BPEL if could look like this:

 <if>
    <condition>count($Variable.ABCpart/*[local-name() = 'ABC']/*[local-name() = 'ServiceCharacteristic']/*[local-name() = 'Code' and text() = 'CCC'])>0</condition>
    <!-- remaining activities-->
 </if>

This assumes that you store your the XML in a variable called Variable and a messagePart called ABCpart. You have to adjust this to your setting for the expression to work.

于 2014-04-04T07:44:37.367 に答える