Are there any alternative methods to using libxslt for XSLT 3.0 features in PHP?

The issue is that libxslt, the default XSLT processor in PHP, does not fully support XSLT 3.0 features. One alternative method to use XSLT 3.0 features in PHP is to use the Saxon/C library, which is a PHP extension that provides support for XSLT 3.0 features.

<?php

// Load the Saxon extension
$saxonProcessor = new Saxon/C/Processor(true);

// Create a transformer for XSLT 3.0
$xsltTransformer = $saxonProcessor->newXslt30Processor();

// Load the XSLT stylesheet
$xsltTransformer->compileFromFile("stylesheet.xsl");

// Load the XML input
$xmlProcessor = $saxonProcessor->newDocumentBuilder();
$xmlDocument = $xmlProcessor->buildFile("input.xml");

// Transform the XML using XSLT 3.0
$result = $xsltTransformer->transformToValue($xmlDocument);

// Output the transformed result
echo $result->getStringValue();

?>