title: conditional match for multiple attributes using XSLT
body: <p>Below is the input XML</p>
  
  <pre><code>    &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ces:names:specification:ces:schema:all:4:0"&gt;
      &lt;soapenv:Header/&gt;
      &lt;soapenv:Body&gt;
          &lt;ces:ShipNotice Version="4.0" xmlns:ces="urn:ces:names:specification:ces:schema:all:4:0"&gt;
              &lt;ces:Header&gt;
                  &lt;ces:From&gt;
                  &lt;/ces:From&gt;
                  &lt;ces:To&gt;
                  &lt;/ces:To&gt;
              &lt;/ces:Header&gt;
              &lt;ces:ShipNoticeBody&gt;
                  &lt;ces:ShipNoticePartners&gt;
                      &lt;ces:Buyer&gt;
                          &lt;ces:PartnerInformation&gt;
                              &lt;ces:PartnerIdentifier Agency="AGIIS-EBID"&gt;8049915600000&lt;/ces:PartnerIdentifier&gt;
                          &lt;/ces:PartnerInformation&gt;
                      &lt;/ces:Buyer&gt;
                      &lt;ces:OtherPartner PartnerRole="ShipTo"&gt;
                          &lt;ces:PartnerInformation&gt;
                              &lt;ces:PartnerIdentifier Agency="AGIIS-EBID"&gt;8049915600000&lt;/ces:PartnerIdentifier&gt;
                          &lt;/ces:PartnerInformation&gt;
                      &lt;/ces:OtherPartner&gt;
                      &lt;ces:OtherPartner PartnerRole="BillToParty"&gt;
                          &lt;ces:PartnerInformation&gt;
                              &lt;ces:PartnerIdentifier Agency="AGIIS-EBID"&gt;1024122440000&lt;/ces:PartnerIdentifier&gt;
                          &lt;/ces:PartnerInformation&gt;
                      &lt;/ces:OtherPartner&gt;
                  &lt;/ces:ShipNoticePartners&gt;
                  &lt;ces:ShipNoticeDetails&gt;
                  &lt;/ces:ShipNoticeDetails&gt;
              &lt;/ces:ShipNoticeBody&gt;
          &lt;/ces:ShipNotice&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>I need to test for incoming request if the value of <strong>Buyer and  Shipto and Billtoparty</strong> can be <strong>AGIIS-EBID or EAN</strong>.</p>
  
  <p>I did ask similar question before 
  <a href="https://stackoverflow.com/questions/28332660/xpath-expression-gives-multiple-values" title="Previous thread">Previous thread</a></p>
  
  <p>In previous thread the value I was testing was same.</p>
  
  <pre><code>&lt;xsl:when test="
   ($Buyer='AGIIS-EBID' and  $Shipto='AGIIS-EBID' and $Billto='AGIIS-EBID') 
   or ($Buyer='EAN' and  $Shipto='EAN' and $Billto='EAN') 
   or ($Buyer='GLN' and  $Shipto='GLN' and $Billto='GLN')"&gt;
  </code></pre>
  
  <p>My question is how to test the condition for <code>Agency@Buyer, Agency@Shipto, Agency@billtoParty</code> if the value will be <strong>AGIIS-EBID</strong> or <strong>EAN</strong></p>
  
  <p>I mean in the soap request always Buyer,Shipto, billtoparty can have different sequence like <code>Buyer=AGIIS-EBID,Shipto=EAN,billtoparty=AGIIS-EBID or Buyer=EAN,Shipto=EAN,billtoparty=AGIIS-EBID or Buyer=AGIIS-EBID,Shipto=EAN,billtoparty=EAN</code></p>
  
  <p>I was thinking to do something like this</p>
  
  <pre><code>&lt;xsl:when test="($Buyer='AGIIS-EBID' and  $Shipto='AGIIS-EBID' and $Billto='AGIIS-EBID') or ($Buyer='AGIIS-EBID' and  $Shipto='EAN' and $Billto='AGIIS-EBID')($Buyer='AGIIS-EBID' and  $Shipto='AGIIS-EBID' and $Billto='EAN') or ($Buyer='EAN' and  $Shipto='EAN' and $Billto='EAN')"&gt;
  </code></pre>
  
  <p>Can anyone please advise for different approach?</p>
  
  <p>Update for the questions.</p>
  
  <p>@michael.hor257k I am sorry.. three agency objects (Buyer, ShipTo and BillToParty), You are correct it can be positive ( AGIIS-EBID or EAN).. If it is positive I need to accept the message, however if its negative I need to reject the message saying @Agency didn't match the AGIIS or EAN for buyer and Shipto and Billparty. </p>
  
  <p>The problem I am facing is Agency objects <code>(Buyer, ShipTo and BillToParty)</code> should match <code>( AGIIS-EBID or EAN)</code>, but in what manner they come I don't know.</p>
  
  <p><strong>Below are the different ways values may get assigned.</strong></p>
  
  <p>Eg: (<code>Buyer='AGIIS-EBID'and Shipto='EAN'and Billtoparty='AGIIS-EBID') or (Buyer='EAN' and Shipto='EAN' and Billtoparty='AGIIS-EBID') or (Buyer='AGIIS-EBID' and Shipto='EAN' and Billtoparty='EAN'</code>)` so on ....</p>
  
  <p>One more thing I want to add I have to check the positive condition for <code>@Agency</code> in <strong>Buyer and Shipto and BilltoParty</strong></p>