by makecheck · 17y ago · 0 comments
For instance, use something completely plain but deceptively simple, like reStructuredText. This can be parsed or edited by a ton of established tools. It's also easily "diffed". Text formats are also well handled by revision control tools (one of which should be used, publicly, by the editors of these documents). This even achieves the clean markup he desires, because multiple tools can parse .rst files and produce very good HTML out of them.
If you run the pdf through "pdftotext -layout", you get a very readable text file which is probably easier to parse than any XML they'd come up with. (Probably easier to deal with than the HTML that Word produces.)
If you want to extract metadata or break it into sections to load into your custom web app, it'd be a couple hours work with your favorite scripting language. (Anything with decent regular expression support.)
(If you want boldface/italics, I'd recommend tweaking the backend of pdftotext.)
However, these aren't adequate for structured data that falls outside the scope of a generic print document. For that, I would recommend YAML or JSON over XML, not only because they're human-readable but also because they're far less verbose.
I just hope that they don't try to chop up something that should be "just a document" into a pile of ugly marked-up containers that make it very hard to see what's even in the document anymore.