RFC proposal: Provide support for XSLT 3.0, XPath 3.1, and XQuery 3.1
| From: | O'Neil Delpratt | Date: | Tue, 03 Oct 2017 09:04:57 +0000 |
| Subject: | RFC proposal: Provide support for XSLT 3.0, XPath 3.1, and XQuery 3.1 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-100811@lists.php.net to get a copy of this message | ||
Hi,
We are considering submitting an RFC along the following lines and welcome your comments:
** Provide support for XSLT 3.0, XPath 3.1, and XQuery 3.1 **
PHP is frequently used to create web services that process XML input and deliver HTML to web
clients. Often this is done by invoking XSLT transformations. The XSLT processor currently provided
in the PHP core, however, only supports the XSLT 1.0 standard published in 1999. XSLT has moved on
significantly since then, with XSLT 2.0 in 2007 and XSLT 3.0 in 2017. The newer standards provide
many productivity benefits: regular expressions, grouping, multiple output files, support for JSON,
support for HTML5, independent compilation of modules, to name a few. By failing to support these,
PHP is becoming a less attractive development platform for XML-centric applications.
XML has been superseded by JSON as the format of choice for simple configuration and data files, but
XML remains of strategic significance for document-based processing and for the vast number of
industry-standard data exchange formats defined by XML schemas. XSLT 3.0 allows XML and JSON data to
be mixed and combined.
PHP users needing access to XSLT 2.0 or 3.0 processing typically use messy workarounds, such as
sending transformation requests over HTTP to a Java-based server, or using Java bridge technologies.
Recently a version of Saxon has been developed with a native PHP API, and the aim of this RFC is to
move this implementation into the PHP Core. The existing XSLTProcessor will remain available and
will continue to provide XSLT 1.0 only, so existing applications will not be disrupted.
Enhancing the existing XSLTProcessor is not an option: it has fallen too far behind for this to be
viable.
The Saxon implementation of XSLT 3.0 is a recognized leader in this field. This proposal offers to
include the open-source version of Saxon (Saxon-HE) in the PHP core. Saxon-HE includes support for
the minimum conformance levels of XSLT 3.0, XPath 3.1, and XQuery 3.1 defined by the W3C
specifications, as well as some optional features such as serialization support. It achieves 100%
pass rates for the relevant W3C test suites. (It excludes schema-aware processing, higher-order
functions, streaming, and some other advanced options). The same API can also be used to invoke the
commercial versions of Saxon, which support additional functionality and performance.
Saxon-HE/C is already available for PHP 7 as a free-standing product. Apart from the PHP interface,
the source code is Java, and the product is built for the PHP platform using the (non-open-source)
Excelsior JET compiler. Excelsior have a licensing scheme enabling the compiler to be used by open
source projects (see: https://www.excelsiorjet.com/free <https://www.excelsiorjet.com/free>). Saxonica would
continue to support development of the project and welcome contributors to help maintain and
implement new features especially in PHP-specific areas of the project.
Info on the latest Saxon/C release: http://www.saxonica.com/saxon-c/index.xml
<http://www.saxonica.com/saxon-c/index.xml>
I welcome your comments in this intended proposal.
kind regards,
-------------------------------
O'Neil Delpratt
Software Developer, Saxonica Limited
Email: oneil@saxonica.com <mailto:oneil@saxonica.com>
Twitter: https://twitter.com/ond1 <https://twitter.com/ond1>
Tel: +44 118 946 5894
Web: http://www.saxonica.com <http://www.saxonica.com/>
Saxonica Community site: http://dev.saxonica.com <http://dev.saxonica.com/>
Bug tracking site: https://saxonica.plan.io/ <https://saxonica.plan.io/>