nerdexam
MuleSoft

MCD-LEVEL-1 · Question #95

What DataWeave expression transforms the example XML input to the CSV output? A) B) C) D)

The correct answer is A. Option A. Correct answer is as below. Attributes in the incoming xml payload are always accessed using @.Similarly item is required as we have multiple items in the request output application/csv payload.sale.item map ((value, index) -> { sale: value.@saleId, itemName: value.desc…

Transforming Data with DataWeave

Question

What DataWeave expression transforms the example XML input to the CSV output? A) B) C) D)

Exhibit

MCD-LEVEL-1 question #95 exhibit

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D

How the community answered

(51 responses)
  • A
    71% (36)
  • B
    4% (2)
  • C
    18% (9)
  • D
    8% (4)

Explanation

Correct answer is as below. Attributes in the incoming xml payload are always accessed using @.Similarly *item is required as we have multiple items in the request output application/csv payload.sale.*item map ((value, index) -> { sale: value.@saleId, itemName: value.desc, itemPrice: (value.quantity) * (value.price), item: value.@itemId

Topics

#DataWeave#XML to CSV#data transformation#DataWeave expression syntax

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice