News for hackers. Stuff that matters.
Re:LinkedDataHub: The Knowledge Graph Notebook by jitl on Thursday June 23, 2022 @07:06PM (#31856200)
What's good about XSLT? Is its ecosystem substantially better than alternative options like simple string templating a la https://pkg.go.dev/html/template?
Re:LinkedDataHub: The Knowledge Graph Notebook by stonogo on Friday June 24, 2022 @02:36AM (#31858436)
XSLT is wildly more than a templating engine. It can (and has) been used to e.g. specify a protocol and generate software based on it. See XCB for an example. With a sufficiently large corpus you can run queries on XML and generate arbitrary media.

As with most overbearingly flexible technology, it's an incredible pain in the ass to use efficiently, and XSLT processors tend to be plagued with complexity and concomitant performance problems.

Re:LinkedDataHub: The Knowledge Graph Notebook by namedgraph on Friday June 24, 2022 @08:43PM (#31871332)
No complaints about the Saxon processors here (we're using Saxon-HE server-side and Saxon-JS client-side). The XSLT standards are excellent, as is the quality of Saxon implementations.
Re:LinkedDataHub: The Knowledge Graph Notebook by nl on Thursday June 23, 2022 @08:02PM (#31856535)
> What's good about XSLT?

Nothing. It was a bad choice in its heyday (I worked on some projects way back then).

> Is its ecosystem substantially better than alternative options

No.

Re:LinkedDataHub: The Knowledge Graph Notebook by namedgraph on Friday June 24, 2022 @08:28PM (#31871228)
Absolutely. XSLT is a data transformation technology, not a template language.
Re:LinkedDataHub: The Knowledge Graph Notebook by jitl on Saturday June 25, 2022 @02:48AM (#31873134)
Can you describe a task that XSLT makes substantially easier to build/more correct/faster to execute? Saying “yep its good” gives an opinion but after looking at XSLT docs I am not “getting it”. Why do I want this? I transform data all the time with a bash script, is XSLT like bash?
Re:LinkedDataHub: The Knowledge Graph Notebook by namedgraph on Saturday June 25, 2022 @04:32AM (#31873517)
I use it in ETL whenever I have an XML source, then I use XSLT to lift it to RDF (either RDF/XML or TriX). I use it for the UI where I'm transforming RDF/XML to HTML. I'm also using for the interactive parts instead of Javascript (or React or Svelte etc.), but that's the interactive XSLT extension that goes beyond the standard.

XML to XML, XML to RDF, JSON to XML and XML to JSON, XML to text -- XSLT can be used for all kinds of transformations. 3.0 also supports streaming transforms, which is very useful for large input files.

XSLT is a declarative DSL made specifically for the XML data model. It does limited things such as navigating the XML tree but does them really well. It lifts the abstraction level so you can focus on the transformation. You can transform XML with bash or a general purpose language like Java, but it will never be so concise or effective.