3 ms·
XML Is Not Injective
- icedchai 6y agoThis 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.
- compressedgas 6y agoI think there might be an error in the examples as the second example does not have a single root element. 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. element: <a>b0</a> array of two elements: <array><a>b0</a><a>b1</a></array> array of one element: <array><a>b0</a></array>
- code-faster 6y agoAh, they're meant to be xml fragments, not full xml documents. In my limited experience I haven't seen people use the <array> container and the xml parser still works, although it is a good idea.
- compressedgas 6y agoIt might be something other than <array>. The name depends on the DTD. It does need a DTD that has the concept of allowing either a single item or a container.