我如何缩进给定的XML [英] how can i indent a given XML

查看:76
本文介绍了我如何缩进给定的XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有最简单的方法来缩进给定的XML?

我已经使用XMLDocument类来缩进它.它对我有用,但在XML文件中添加了一些特殊字符.

is there any easiest way to indent given XML ?

i have used XMLDocument class to indent it. it works for me but add some special char''s in XML file.

what to do ?

推荐答案

"...在XML文件中添加一些特殊字符" 到底是什么意思?这些不祥字符添加在哪里,它们的外观如何.如果您有可用的十六进制编辑器,则可以告诉我们这些字符的二进制表示形式.

在我看来,您可能是指 BOM [
What exactly do you mean by "... add some special chars in XML file"? Where are these ominous characters added and what do they look like. If you have a Hex-editor available you could tell us the binary representation of these characters.

It just occurred to me you could be refering to the BOM[^]. Since XML files are often UTF-8 encoded this might also apply to your case. A side note though: Even though XML is a human readable data format does not mean it should be part of the human machine interface. XML must be well formed and not nicely formatted.

Best Regards,

—MRB


这篇关于我如何缩进给定的XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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