Closed tvelkoff closed 4 years ago
Now I know precisely what the issue is. In 1.2, the default TransformerFactory (Xalan) is selected, and it does not support XSLT 2.0. In 2.0-SNAPSHOT, the API supports injection of the TransformerFactory like this:
Schematron schematron = Schematron.newInstance(createSchematronSource(getSchematronFile()))
.withTransformerFactory(TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", SchematronReader.class.getClassLoader()));
And of course, Saxon handles XSLT 2.0 without problems.
I don't see how the TransformerFactory can be injected in 1.2. So the best solution for me is to build 2.0-SNAPSHOT locally for now, and pull it from the Maven Repository when 2.0 is published.
Lieber Herr Volkoff,
Vielen Dank für das detailliert Feedback!
Version 1.x of schxslt-java worked with the assumption, that the user sets the respective java property javax.xml.transform.TransformerFactory
. I found this to be problematic and was also unsatisfied with the structure of the 1.x classes.
I hope to be able to release 2.0 at the end of December.
With best regards, -- David Maus
Schön!
— Ted Velkoff
Lieber Herr Volkoff,
Version 2.0 ist auf Maven Central verfügbar.
With best regards, -- David
Lieber Herr Maus,
Ausgezeichnet! Vielen Dank, Ted
Get Outlook for iOS
On Tue, Jan 14, 2020 at 2:47 PM -0500, "David Maus" notifications@github.com wrote:
Lieber Herr Volkoff,
Version 2.0 ist auf Maven Central verfügbar.
With best regards,
-- David
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
Lieber Herr Maus, Ich denke, es war mein Schicksal, Schxslt zu entdecken! :)
I have recently been working on a plugin for measuring XSLT code quality with SonarQube. During my research I found https://github.com/sonar-xsl and https://github.com/mricaud/xslt-quality. From the latter project, I have successfully applied xsl-common.sch against a body of code for my work. My Sonar plugin uses schxslt-java to apply this schematron file to my set of XSLT files.
Initially I prototyped this by downloading the schxslt and schxslt-java projects from GitHub and building them locally. Now I have gone back to the POM for my Sonar plugin and changed the versions to those found in the mvnrepository. But when I replace this code using 2.0-SNAPSHOT
with this code using 1.2
I get an error at runtime (when running
mvn sonar:sonar
on my files) while processing the schematron that looks like this:In 2.0, a
Source
is passed to thenewInstance
factory method, whereas, in 1.2, theDOMSource
is built by the constructor, which callsloadDocument
. It seems that either I am misusing the 1.2 API or I should continue depending on my local build of 2.0 until it is published to Maven Central. Do you perhaps have any advice on this?Vielen Dank fuer ihre Arbeit an Schxslt!