MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 Exam - Question 113


Refer to the exhibit.

What DataWeave expression transforms the example XML input to the CSV output?

A.

B.

C.

D.

Show Answer
Correct Answer:

The correct DataWeave expression to transform the given XML input to the CSV output is option A. Here's the explanation: To access XML attributes in DataWeave, you need to use the '@' symbol. In the provided DataWeave expression (option A), the saleId and itemId are correctly accessed using value.@saleId and value.@itemId. Additionally, to transform the collection of items, the correct XPath selector is used, which is *item. Other options either do not use the '@' symbol or do not use the correct collection selector. Therefore, option A is the correct answer as it accurately processes XML attributes and the collection structure.

Discussion

6 comments
Sign in to comment
nilan84
May 29, 2021

A is corect

Anseal
May 25, 2021

A is correct: collection of items (*items), as well as XML param: @param.

chengl
May 10, 2021

B is correct.

chengl
May 14, 2021

Correction, A is correct, xml attribute is accessed with @.

miguel_romero
Dec 15, 2021

A is correct

Maxroyo
Aug 29, 2022

A is correct

ExamDev
Jan 23, 2024

A is correct, xml attribute is accessed with @.