Convert XML data to CSV string using XQuery
Consider the following XML:
<LIST>
<Name>Jon</Name>
<Name>Dan</Name>
<Name>Bill</Name>
<Name>Jack</Name>
</LIST>
I need the output as a string as CSV, for example Jon,Dan,Bill,Jack
using XQuery.
I did it using FLWOR and expressions and normalize-space
then replaced the spaces with commas. However, I believe there should be a better way to do this in XQuery.
+3
source to share