使用XSLT将XML转换为CSV

时间:2022-06-20 21:20:19

How to convert XML to CSV (to be shown in Excel file) using XSLT?

如何使用XSLT将XML转换为CSV(在Excel文件中显示)?

Provided XML value itself contains comma, e.g.

提供的XML值本身包含逗号,例如

<name>The,Bad Boy</name>

My logic considers "The" & "Bad boy" as separate values as it goes in different columns after opening in Excel file.

我的逻辑将“The”和“Bad boy”视为单独的值,因为它在Excel文件中打开后进入不同的列。

1 个解决方案

#1


4  

It's not that this type of question would not have been answered before:

这并不是以前没有回答过这类问题:

By the way, "CSV" does not mean that values cannot contain commas or must be separated by commas.

顺便说一句,“CSV”并不意味着值不能包含逗号或必须用逗号分隔。

Excel can understand CSV that is separated by other characters than comma (tab, for example), and values that contain the separator can be enclosed in quotes.

Excel可以理解由逗号(例如制表符)以外的其他字符分隔的CSV,并且包含分隔符的值可以用引号括起来。

#1


4  

It's not that this type of question would not have been answered before:

这并不是以前没有回答过这类问题:

By the way, "CSV" does not mean that values cannot contain commas or must be separated by commas.

顺便说一句,“CSV”并不意味着值不能包含逗号或必须用逗号分隔。

Excel can understand CSV that is separated by other characters than comma (tab, for example), and values that contain the separator can be enclosed in quotes.

Excel可以理解由逗号(例如制表符)以外的其他字符分隔的CSV,并且包含分隔符的值可以用引号括起来。