0

I am trying to figure out how I can skip an attribute or element writing on to XML. For ex:

<File>
  <data>
    <name>...</name>
    <id>...</id>
  </data>
  <noData>..</noData>
</File>

<noData> is enumerated and can only accept 'Y' and this needs to be populated only when there are no records to write in <data>. In other words if values are populated for <data> then I need to skip <noData> or if count of records is 0 then I need to skip <data> and populate <noData> with 'Y'.

I am trying to achieve this SAP BODS but no luck so far.

Can you help?

Basically want to understand how will I skip the elements writing onto XML if their values are not populated or they got null values.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
SKB
  • 11
  • 3

1 Answers1

0

Figured out answer for this. This can be done using <choice>...</choice> in xsd. This means either data or noData is populated.

To achieve this on to SAP BODS.. I have used a conditional workflow to populate noData attribute incase of 0 records or data attribute incase of non zero records.

<File>
<choice>
<data>
<name>...</name>
<id>...</id>
</data>
<noData>..</noData>
</choice>
</File>
SKB
  • 11
  • 3