有哪些好的替代序列化格式?

发布于 2024-09-29 03:50:21 字数 102 浏览 0 评论 0原文

我过去曾使用过 XML,但它非常冗长且笨重。我们目前正在使用 YAML,但我发现大多数开发人员在空白方面遇到很多麻烦。是否有类似 YAML 的格式,对空格不敏感,但又不像 XML 那样冗长?

I have used XML in the past, but it is very verbose and clunky. We are currently using YAML, but I am finding that most developers have alot of trouble with the whitespace. Is there a YAML like format that is whitespace insensitive, but not as verbose as XML?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅笑依然 2024-10-06 03:50:22

您不必在 YAML 中使用空格语法。所有数据结构也都有非空白替代品,例如序列[1, 2, 3]和映射{ key: value, k: v }。这称为流样式,而不是 >块样式

另一种选择可能是 JSON,它实际上是 YAML 的子集。它基本上是没有块样式且没有可扩展性的 YAML。

标准 Lisp 列表语法(列表由括号分隔,元素由空格分隔)也是一种非常好的格式。

You don't have to use the whitespace syntax in YAML. All the datastructures also have non-whitespace alternatives, e.g. sequences [1, 2, 3] and maps { key: value, k: v }. This is called flow style as opposed to block style.

An alternative might be JSON, which is actually a subset of YAML. It's basically YAML without block style and without extensibility.

Standard Lisp list syntax (list delimited by parentheses, elements separated by whitespace) is also a very nice format.

简美 2024-10-06 03:50:22

我建议查看 TOML。不区分大小写,但仍然解决了 YAML 中所有复杂的问题。

I recommend checking out TOML. Not case-insensitive, but nevertheless fixing all the problems with complexity in YAML.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文