Parsing XSLT 2.0 and 3.0 files #3320
-
What problem are you trying to solve? From what I understand is that nokogiri is compiled with libxml2 and libxslt that can only handle version 1 XSLTs ? Is there a possibility to be able to parse also 2.0 and 3.0 versions ? Please show your code! Here is the code to reproduce. #! /usr/bin/env ruby
require 'nokogiri'
Nokogiri::XSLT.parse(File.read("/Users/frantisekrokusek/Downloads/EN16931-CII-validation.xslt"))
# fails with error
# RuntimeError: compilation error: element stylesheet
# xsl:version: only 1.1 features are supported
# and more lines Environment
Thank you very much for your help 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for asking about this. Nokogiri currently relies on libxml2, libxslt, and libexslt for XSLT functionality. These libraries do not currently support anything beyond XSLT 1.1. I'm not necessarily an expert in libxslt, but my understanding is that the XSLT 2.0 spec was partly based on XPath 2.0, so adding XPath 2.0 support to libxml2 is probably a prerequisite for adding XSLT 2.0 support to libxslt. The last time I remember the upstream maintainers talking about XPath 2.0 was in this thread from 2007: https://www.mail-archive.com/[email protected]/msg04082.html If this is something you'd like to see, it would be valuable to open an issue upstream and ask the question. There's a new maintainer of libxml2/libxslt since ~2020 (Nick Wellnhof) who's been very responsive and has been willing to make significant changes and improvements to the codebase. |
Beta Was this translation helpful? Give feedback.
Thanks for asking about this. Nokogiri currently relies on libxml2, libxslt, and libexslt for XSLT functionality. These libraries do not currently support anything beyond XSLT 1.1.
I'm not necessarily an expert in libxslt, but my understanding is that the XSLT 2.0 spec was partly based on XPath 2.0, so adding XPath 2.0 support to libxml2 is probably a prerequisite for adding XSLT 2.0 support to libxslt.
The last time I remember the upstream maintainers talking about XPath 2.0 was in this thread from 2007:
https://www.mail-archive.com/[email protected]/msg04082.html
If this is something you'd like to see, it would be valuable to open an issue upstream and ask the question. There's a new mainta…