logoalt Hacker News

echelonyesterday at 1:40 PM6 repliesview on HN

XSLT just needs a different, non-XML serialization.

XML (the data structure) needs a non-XML serialization.

Similar to how Semantic Web's Owl has four different serializations, only one of them being the XML serialization. (eg. Owl can be represented in Functional, Turtle, Manchester, Json, and N-triples syntaxes.)


Replies

int_19hyesterday at 7:56 PM

XQuery is pretty close to "XSLT with sane syntax", if that's what you mean.

But the fundamental problem here is the same: no matter what new things are added to the spec, the best you can hope for in browsers is XSLT 1.0, even though we've had XSLT 3.0 for 8 years now.

marcosdumayyesterday at 6:19 PM

> XML (the data structure) needs a non-XML serialization.

KDL is a very interesting attempt, but my impression is that people are already trying to shove way too much unnecessary complexity into it.

IMO, the KDL's document transformation is not a really good example of a better XSLT, tough. I mean, it's better, but it probably can still be improved a lot.

bokchoiyesterday at 6:50 PM

I just posted this in another comment: https://github.com/Juniper/libslax/wiki/Intro

jimbokunyesterday at 6:02 PM

You're looking for S-expressions.

show 1 reply
alganetyesterday at 2:17 PM

> XML (the data structure) needs a non-XML serialization.

That's YAML, and it is arguibly worse. Here's a sample YAML 1.2 document straight from their spec:

    %TAG !e! tag:example.com,2000:app/
    ---
    - !local foo
    - !!str bar
    - !e!tag%21 baz
Nightmare fuel. Just by looking at it, can you tell what it does?

--

Some notes:

- SemWeb also has JSON-LD serialization. It's a good compromise that fits modern tooling nicely.

- XML is still a damn good compromise between human readable and machine readable. Not perfect, but what is perfect anyway?

- HTML5 is now more complex than XHTML ever was (all sorts of historical caveats in this claim, I know, don't worry).

- Markup beauty is relative, we should accept that.

j45yesterday at 8:23 PM

This is very understandable, where I get left at is the remaining gap between XML and XSLTs and where JSON or another format can cover.

Trying to close the gap often ends up creating more complexity than intended, or maybe even more than XML in some hands.

It definitely would be an interesting piece.