如何将XML数据转换成CSV或纯文本文件?
- 第一步: 加载XML数据。您可以复制并粘贴到您的XML数据源数据“框中,然后单击”加载“按钮。当你这样做的,“源数据”框中将变成一个图形化的XML阅读器,您的XML数据将显示为一个节点树.
- 第二步: 选择你要转换的XML数据。使用图形的XML浏览器来浏览XML节点树,找到你想要的节点,然后单击“单选按钮。如果你选择的节点是一个简单的XML元素,该元素的内容将被转换。如果所选择的节点,是一个复杂的XML元素,其所有子节点的内容将被转换。如果你要转换的整个XML文档,你可以选择根节点。单击转换按钮,选定的XML数据将被转换为纯文本文件.
- 您可以选择您的XML文档的不同节点上重复第2步多次。
- 选择的目标文件格式,CSV或纯文本,通过点击 Options.
How to convert XML data to CSV or plain text?
- Step 1: load XML data. You can copy and paste your XML data to the Source Data box, then click Load button. After you have done so, the Source Data box will turn into a graphical XML viewer and your XML data will be displayed as a node tree.
- Step 2: select the XML data you want to convert. Use the graphical XML viewer to navigate the XML node tree, find the node you want and click the radio button. If the seleted node is a simple XML element, only the content of that element will be converted. If the selected the node is a complex XML element, the content of all its child nodes will be converted. If you want to convert the whole XML document, you can select the root node. Click the Convert button, the selected XML data will be converted to a plain text file.
- You can repeat Step 2 many times by selecting different nodes of your XML document.
- Choose the target file format, CSV or plain text, by clicking Options.
Options
You can use the following options to make the converted text in the format you desire.
- Field Separator: Field separators will make the converted text easy to read or parse. You can specify how to separate the converted data fields. The default separator is a space. You can change it to any string of characters;
- Trim XML Format White Space: Some XML files contain spaces and line breakers for the purpose of formating so that the document can be displayed in a more readable pattern by a text editor. When converted to text, these formating white spaces may not be wanted. You can use this option to trim the unwanted white spaces.
- Add Linebreakers to Rows: If you specify to trim formating white spaces, all the data fields will be converted to one long line. You can use this option to add a line breaker to the end of each row of the XML elements.