Re: [xsl] Why do some people not use XSLT to process XML-formatted data?

Subject: Re: [xsl] Why do some people not use XSLT to process XML-formatted data?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 3 Nov 2024 11:30:45 -0000
> I don't understand why anyone would not use XSLT to process XML documents.
The XSLT language was explicitly designed for processing XML documents, i.e.,
XSLT is a domain specific language (DSL). When a DSL exists, shouldn't it
always be chosen over a general-purpose language such as Java?

People use data binding for two reasons: (a) it avoids the need to learn yet
another language, and (b) it make it easier to integrate the XML-processing
part of the application with other parts that are written in Java for other
reasons. And I agree with you, these are often poor reasons. In particular,
they make it much harder to take advantage  the "semi-structured" nature of
XML, and its inherent potential for handling variety and change.
>
> SAXON processes XSLT using Java. Why? Why doesn't SAXON use XSLT to process
XSLT? Should I infer that the XSLT language is not powerful enough with
certain types of programming?
>

I have written a number of papers over the years on the potential for writing
an XSLT processor in XSLT: see for example

https://www.saxonica.com/papers/xmlprague-2019mhk.pdf

The main difficulty in doing it is the limited set of data structures
available in the XDM data model. XSLT has always been designed as a
special-purpose programming language rather than a general-purpose language,
and writing compilers is not one of those special purposes. We do however have
the front-end of an XSLT compiler written in XSLT as part of the SaxonJS
product.

Michael Kay
Saxonica

Current Thread