且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么要“控制"? XML 1.0中的字符非法?

更新时间:2023-11-03 23:26:22

我的理解是,此范围被禁止,原因是标记语言不需要支持传输和流控制字符,包括它们将创建一个二进制转换中的任何编辑器和解析器都会遇到问题.

My understanding is that this range is barred on the grounds that a markup language should not have any need to support transmission and flow control characters and including them would create a problem for any editors and parsers in binary conversion.

尽管如此,我还是想从蒂姆·布雷(Tim Bray)等人的身上找到任何东西.

I'm struggling to find anything ex cathedra on this from Tim Bray et al though.

一些

edit: some discussion of control chars and a vague admission it wasn't exactly over-engineered:

Mark Volkmann在09:27 AM 17/06/00 -0500写到:

At 09:27 AM 17/06/00 -0500, Mark Volkmann wrote:

我从未见过讨论大多数ASCII控制的原因 XML文档中不允许使用诸如换页符之类的字符.能 任何人都可以告诉我该决定的原因或向我提出规格.那 解释了吗?

I've never seen a discussion of the reason why most ASCII control characters, such as a form feed, are not allowed in XML documents. Can anyone tell me the reason behind that decision or point me to a spec. that explains that?

如果再次执行此操作,我不确定是否会以相同的方式进行操作.一世 没有看到他们有任何真正的伤害.显然,如果您正在优化 对于高度可互操作的 content 标记语言(和XML),它是 怀疑诸如Vertical-Tab和Backspace之类的东西是合法的 依此类推...但是然后如何保持一致\ n和DEL 等等? -蒂姆(Tim)

I'm not sure we'd do it the same way if we were doing it again. I don't see that they do any real harm. Clearly, if you're optimizing for a highly interoperable content markup language (and XML is) it's legitimate to be suspicious of things like vertical-tab and backspace and so on... but then how can it be consistent to leave in \n and DEL and so on? -Tim