xml文件每行的前导空格 [英] leading spaces at each line of an xml file

查看:110
本文介绍了xml文件每行的前导空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在研究一个生成xml文件作为输出的可视化基本代码。在由virtual basic生成的xml文件中,由于这个根元素 - 成员元素,因此在每行的开头都有前导空格。但是,使用此xml文件的目标程序
不需要这些前导空格。我们是否有解决方案从一开始就开始每一行,而不管它是根元素还是成员元素?此外,我考虑逐行读取xml文件,并修剪它
,然后将其重新写入另一个xml文件。有可能吗?如果是这样,你能给我这样的虚拟基本代码示例吗?

I am working on a visual basic code that produces an xml file as an output. In xml file which is produced by virtual basic, there are leading spaces at the beginning of each line because of this root element - member element thing. However, target program which will use this xml file doesnt want these leading spaces. Do we have solution to start each line from the beginning regardless of it is a root element or member element? Also, I thought about reading the xml file line by line and trim it and then re-write it into maybe another xml file. Could it be possible? If so can you give me such example of virtual basic code?

推荐答案

您能否向我们展示一段用于创建相关XML文件的代码?您的问题的正确答案取决于您用于创建XML的API。

Could you please show us a piece of code which you use to create the XML file in question? The right answer to your question depends on the API you use to create your XML.

谢谢,


这篇关于xml文件每行的前导空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆