xml 调用xml_XML纯度的神话?

xml 调用xml

xml 调用xml

Here's a hypothetical.  Say there is an client I'm working with that needs to return Valid XML from their system.  They've given me XML Schemas and said they are representative of the XML returned.  Since Valid follows Well-Formed, sounds good.

这是一个假设。 假设有一个我正在使用的客户端,需要从其系统返回有效XML。 他们给了我XML Schema,并说它们代表了返回的XML。 由于Valid遵循格式正确,因此听起来不错。

Then someone mentions, "oh, well, we can't guarantee that there won't be some < or > or & in the element content.  But, that's no problem, right?"

然后有人提到:“哦,好吧,我们不能保证元素内容中不会有<或>或&。但是那没问题,对吗?”

I said, "Well, then technically you are not sending us XML.  If you can't escape (or CDATA) out the stray content with < >, then you're not even returning less-than/greater-than delimited files. What if I gave you content like this "123123324","2003-04-05","Scott ",Hans,"elman","Portland?"  We have to agree on some fundamentals here.  The XML 1.0 spec (and all tools based on it) is very specific." (They won't even CDATA the stuff)

我说:“好吧,从技术上讲,您不是在向我们发送XML。如果您无法使用<>逃避(或CDATA)错误内容,那么您甚至都不会返回小于/大于分隔的文件。如果我给您这样的内容“ 123123324”,“ 2003-04-05”,“ Scott”,Hans,“ elman”,“ Portland”,该怎么办?我们必须在这里就一些基础知识达成一致。XML 1.0规范(以及所有基于它的工具)是非常具体的。” (他们甚至都不会CDATA这些东西)

The response? "Well, that's a purist's viewpoint."

响应? “好吧,这是纯粹主义者的观点。

I guess I got too mired in the Judeo-Christian Ethic of "Thou shalt not return malformed XML."

我想我对犹太教和基督教徒的道德观念太迷恋了,“不要返回格式错误的XML”

QUESTION: What level of Dante's Inferno would I be relegated to if I pre-process this XML-y (pronounced: 'smelly') to make it well-formed?

问题:如果对XML-y (发音为:“ smelly” )进行预处理以使其格式正确,我将被降级到Dante的Inferno?

翻译自: https://www.hanselman.com/blog/the-myth-of-xml-purity

xml 调用xml

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值