Live data from Hacker News

Xee: A Modern XPath and XSLT Engine in Rust

blog.startifact.com

201–210 of 245 posts

Re: Xee: A Modern XPath and XSLT Engine in Rust

#201
post #22

I recently had the pleasure of using XSLT after never having seen it before. I used it to transform a huge 130K line XML manifest with MAPI property metadata into C# source code. It was so simple, readable, and intuitive to use.

I learnt XSLT in university back in the early/mid part of the first decade of this century. I didn't much enjoy it. I've never used it, but all my career I've had to deal with terrible ad hoc templating languages. I recently had total freedom to choose what terrible ad hoc templating language to use, and I chose XSLT. I actually totally liked it: and it seemed to have everything I've needed. In previous jobs, there was always tickets that amounted to "make a fork of the terrible ad hoc templating language and hack it until it does this", but I reckon XSLT could do everything and then some.

Re: Xee: A Modern XPath and XSLT Engine in Rust

#202

Fun fact: XSLT still enjoys broad support across all major browsers: https://caniuse.com/?search=xslt

I can’t say this with certainty, but I have some reason to suspect I might be partially to blame for this fun fact! A couple years ago, I stumbled on a discussion considering deprecation/removal of XSLT support in Chrome. At some point in the discussion, they mentioned observing a notable uptick in usage—enough of an uptick (from a baseline of approximately zero) that they backed out. The timing was closely correlate…

And this kids is one more reason for us to use testing while developing

Re: Xee: A Modern XPath and XSLT Engine in Rust

#204

I yearn for the day when people will stop considering the main advertising bullet point feature that their software was written in Rust. Rust 1.0 was released a decade ago, plenty of time for its alleged technical advantages to become apparent. It's like a handbag whose main claim to being a premium product isn't workmanship or materials, but that it has Gucci on its side.

> It's like a handbag whose main claim to being a premium product isn't workmanship or materials, but that it has Gucci on its side.

Knockoffs aside, the latter is intended to serve as a proxy for the former. I too will be happy when Rust is the boring everyday choice, but in 2025 we still see new buffer overflows every day. And if I'm picking a library, I still want to know if it's in the same language as the app it's going into.

Re: Xee: A Modern XPath and XSLT Engine in Rust

#205

Earlier quoted context omitted.

JSON5 is a real sweet spot for me. Closing brackets, but I don't have to type every tag twice. Comments and trailing commas.

I find for deeply hierarchical data that XML is much easier to read.

interrsting. I find the signal/noise ratio of XML really bad.

what I really dread in XML though is that XML only has idref/id standardized, and no path references. so without tool support you can't navigate to a reference target.

which turns XML into the "binary" format for GUI tools.

Re: Xee: A Modern XPath and XSLT Engine in Rust

#206

This, thirty years later, is the best pitch for XML I’ve read. Essentially, it’s a slow moving, standards-based approach to data interoperability. I hated it the minute I learned about it, because it missed something I knew I cared about, but didn’t have a word for in the 90s - developer ergonomics. XML sucks shit for someone who wants to think tersely and code by hand. Seriously, I hate it with a fiery passion. Happ…

You should try using a LISP like Racket for XML. Because XML can be expressed directly as S-expressions, XML and LISP go together like peanut butter and jelly. Hello world (greeting ((attr "val") (href "#")) "Hello " (thing "world"))

a lisp... like dsssl ? ;-)

Re: Xee: A Modern XPath and XSLT Engine in Rust

#207

Does XSLT still used in a new projects? I have impression, that it was not popular even when XML was. For example, apache HTTPD never has official module to serve XML via XSLT transformation. And XSL:FO looks even more obscure.

XSL:FO is dead for all practical purposes. XSLT was not popular for its original intended application - which is to say, serving XML data from web servers and translating it to HTML (or XSL:FO, or ...) on the client as needed. However, it was used plenty for XML processing outside of that particular niche. New projects these days rarely have to process complicated XML to begin with. But when you do, I'd say XSLT (or…

syntext serna was such an engineering marvel. a wysiwyg XML editor that used xslt to fo to specify your rendering. was built in the context of docbook and dita but did work for any xsd with a xslt to fo. amazing technology. ahead of its time. and then came json :-(

Re: Xee: A Modern XPath and XSLT Engine in Rust

#208
post #140

Earlier quoted context omitted.

My favorite and only use of XSLT that still works pretty well is to allow people to browse my RSS feed as if it were a web page. https://joeldueck.com/feed.atom

That's an awesome idea! Very cool! I might just do that for my own RSS feed, and credit you for the great idea.

It definitely wasn’t my idea! I got it from Matt Webb: https://github.com/genmon/aboutfeeds (there’s a .xsl file in the “tools” folder there).

Re: Xee: A Modern XPath and XSLT Engine in Rust

#209
post #176

Earlier quoted context omitted.

XSLT will perform the transformations that you instruct it to do. It does not wipe out whitespace just on its own. Do you mean that you'd like facilities to nicely reindent the output?

> It does not wipe out whitespace just on its own. Sounds nice but doesn't match my lived experience with both Chrome's built-in XSLT processor and `xsltproc`. (I was using XSLT 1.0, for legacy reasons, so maybe this is an XSLT 1.0 issue?) > Do you mean that you'd like facilities to nicely reindent the output? No, I do mean preserve whitespace (i.e., formatting), such as between elements and between attributes.

usually whitespace (in) significance is specified in the XML schema. so if you provide a schema and instruct the xslt engine to comply with the schema, do your issues persist?

Re: Xee: A Modern XPath and XSLT Engine in Rust

#210
post #179

Earlier quoted context omitted.

XML is honestly the greatest and I'm not sure why it didn't take off. People sometimes ask me, "what impacted the humanity the most - electricity? antibiotics? combustion engines?" -- no, no, and no, it was XML. Everything can be expressed in XML, and basically everything can read and write XML. It's like the whole world could read and write the same files. Imagine what if those files included programs, that's what X…

Maybe one reason is its verbosity for small everyday tasks, like config files or when representing arrays. If xml allowed empty tags there probably would be no need for json.

Empty tag as in ?
Post reply on HN