0 Replies Latest reply: Apr 13, 2012 5:40 PM by AppsDBAremote RSS

    count how many XML tag existed

    AppsDBAremote
      I am new in BI publisher and hope someone can give me some help. I need to display an invoice number and term-sequence_number. If the invoice number has only 1 term_sequence_number, just display the invoice number. However, if the invoice has 2 or more term_sequnce_number, display invoice number then the term-sequence_number. For exampe

      <LIST_G_INVOICE>
      <G_INVOICE>
      <INVOICE_NUMBER>123456</INVOICE_NUMBER>
      <WHATEVER>35345</WHATEVER>
      <LIST_G_INV_TERM>
      <G_INV_TERM>
      <TERM_SEQUENCE_NUMBER>1</TERM_SEQUENCE_NUMBER>
      <AMOUNT>100.39</AMOUNT>
      </G_INV_TERM>
      <G_INV_TERM>
      <TERM_SEQUENCE_NUMBER>2</TERM_SEQUENCE_NUMBER>
      <AMOUNT>482435</AMOUNT>
      </G_INV_TERM>
      <G_INV_TERM>
      <TERM_SEQUENCE_NUMBER>3</TERM_SEQUENCE_NUMBER>
      <AMOUNT>3848</AMOUNT>
      </G_INV_TERM>
      </LIST_G_INV_TERM>
      </G_INVOICE>


      in my example, this invoice will have 3 sub invoice. The first subinvoice will have invoice number 123456=1. The second subinvoice has 123456=2 and third subinvoice has 123456=3 . however, if there is only ONE TERM_SEQUENCE_NUMBER, the subinvoice invoice ( well there is only one anyway ) will be 123456

      I am currently in G_INV_TERM group. I have the following

      <?../../INVOICE_NUMBER?><?if:count(TERM_SEQUENCE_NUMBER)>1?>
      =<?TERM_SEQUENCE_NUMBER?>
      <?end if?>

      But so far, the condition is always false and the count(TERM_SEQUENCE_NUMBER) always return 1 even i have 3 TERM_SEQUENCE_NUMBER xml tag

      How can I return the condition so, in my example, it will return ture and the total count of TERM-SEQUENCE_NUMBER is 3