3 ms·
Sorry not a good example by deliberately bloating the XML and also adding double-line spacing. title, author and publication-date should be XML attributes as th
by lenkite 4y ago
Sorry not a good example by deliberately bloating the XML and also adding double-line spacing. title, author and publication-date should be XML attributes as they don't have children and are singular data of a singular data type.
<books xmlns='http://www.example.com/books'>
<book author="Frederick Brooks"
publication-date="1995-06-30"
title="Mythical Man Month" />
<book author="Eric Gunnerson"
publication-date="2001-06-30"
title="Programmer’s Introduction to C#" />
</books>
Sweet, succinct, elegant and can be validated with an XSD and given auto-complete and tab placeholder support in your editor/IDE.
The above can be parsed without bugginess or insecurity - those feel like opinions to me. We manage to parse and render trillions of HTML markup following the same style without issues.
- eadmund 4y ago> Sorry not a good example I just pulled the example from the article ‘Designing Extensible, Versionable XML Formats’ hosted at xml.com. Presumably xml.com has decent examples of XML? I an pretty sure that author is not a singular data type, since it is possible for a book to have multiple authors. > Sweet, succinct, elegant I think it’s still inelegant in comparison to the S-expression version. > The above can be parsed without bugginess or insecurity - those feel like opinions to me. A quick Googling for ‘xml parsing cve’ shows plenty of hits. Are you familiar with billion-laughs exploits? XML is well-known for them: https://en.wikipedia.org/wiki/Billion_laughs_attack https://en.wikipedia.org/wiki/Billion_laughs_attack