Forgot your password?
typodupeerror

Submission + - XMQ/HTMQ A better html than html? (libxmq.org) 3

anjara writes: HTML and XML are the perhaps mostl widely used computer languages in the world. Alas, they are also hard to pretty print. In fact, it is nigh impossible to pretty print HTML without potentially introducing significant whitespace.

The XMQ language (https://libxmq.org) language can store XML/HTML (and JSON) documents and always be pretty printed. Use the xmq tool to pretty print any XML/HTML/JSON into XMQ which is much easier to read and can be syntax colored in your terminal or in your browser.

You can also convert back and forth between XMQ and XML, HTML and JSON, taking advantage of both XML toolchains and JSON toolchains.

Here is an excerpt from the XMQ homepage:

XML can be human readable/editable if it is used for markup of longer human language texts, ie books, articles and other documents etc. In these cases the xml-tags represent a minor part of the whole xml-file.

However XML is often used for data storage and configuration files (eg pom.xml). In such files the xml-tags represent a major part of the whole xml-file. This makes the data storage and config files hard to read and edit directly by hand. Today, the tags are a major part of html files as well, which is one reason why html files are hard to read and edit.

XMQ solves the verbosity of tags by using braces to avoid closing xml-tags and parentheses to surround the attributes. XMQ solves the whitespace confusion by requiring all intended whitespace to be quoted.

You can try it now on GNU/Linux, MacOS and Windows!

This discussion was created for logged-in users only, but now has been archived. No new comments can be posted.

XMQ/HTMQ A better html than html?

Comments Filter:
  • The syntax of some of these examples seems more verbose and harder to follow than just writing the XML or JSON itself, especially the anchor examples. Aside from that, XML to JSON conversion exists, though with limitations, seemingly the same ones, such as no comments in JSON so instead you're adding an additional key. Might as well just write one or the other and convert, especially because libxmq is nearly JSON anyway.
    • The syntax of some of these examples seems more verbose and harder to follow than just writing the XML or JSON itself, especially the anchor examples. Aside from that, XML to JSON conversion exists, though with limitations, seemingly the same ones, such as no comments in JSON so instead you're adding an additional key. Might as well just write one or the other and convert, especially because libxmq is nearly JSON anyway.

      This seems to be an effort in part at minification which in JSON can be achieved by other efforts such as shortening the keys and having an agreed map on both sides. If they're going for readability, I'm not sure if this is more readable than JSON. It might appear more readable than XML. I look forward to this standard becoming the 15th universal standard [xkcd.com].

      The discussion forum on GitHub is inactive at the moment with 1 discussion about windows [github.com]. As for adding in comments to JSON that's probably not requir

      • by anjara ( 5180695 )
        Hi! Author here, the idea is not to modify JSON. The idea is improve how XML/HTML can be visualized/pretty printed and edited. There have been sooo many attempts before at this, you can check out this list of previous attempts [libxmq.org]

        So I would say its the 70th attempt not 15th.... ;-) However contrary to most of the previous attempts, xmq is fully implemented and can convert back and forth between XMQ and XML/HTML (including namespaces and DTDs et al.) (and by accident it can also map to/from JSON, but the purp

"Why should we subsidize intellectual curiosity?" -Ronald Reagan

Working...