TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

XML Is Not Injective

3 pointsby code-fasteralmost 5 years ago

2 comments

compressedgasalmost 5 years ago
I think there might be an error in the examples as the second example does not have a single root element.<p>If you need to spot an array vs an element, you have to use a container tag to express it. This is the same structure as is needed to encode algebraic data types.<p><pre><code> element: &lt;a&gt;b0&lt;&#x2F;a&gt; array of two elements: &lt;array&gt;&lt;a&gt;b0&lt;&#x2F;a&gt;&lt;a&gt;b1&lt;&#x2F;a&gt;&lt;&#x2F;array&gt; array of one element: &lt;array&gt;&lt;a&gt;b0&lt;&#x2F;a&gt;&lt;&#x2F;array&gt;</code></pre>
评论 #23446278 未加载
icedchaialmost 5 years ago
This seems like a misunderstanding of XML. XML has no built in concept of arrays or properties. This is a problem with your application of XML, not XML itself.