saxon

Saxon 9 HE, Java - Static errors, XTSE0210, XTSE0165, XPST0017

二次信任 提交于 2021-02-11 14:30:56
问题 When invoking an XSL transform using Saxon from my application I receive the following error Static error at xsl:import on line 34 column 45 XTSE0210: A stylesheet cannot import itself Static error at xsl:import on line 42 column 39 XTSE0165: Reported 1 error in imported stylesheet module Static error in {leg:IsCurrentWelsh(/)} in expression in xsl:when/@test on line 101 column 43 XPST0017: Cannot find a 1-argument function named . . . net.sf.saxon.trans.XPathException: Errors were reported

Saxon 9 HE, Java - Static errors, XTSE0210, XTSE0165, XPST0017

可紊 提交于 2021-02-11 14:30:21
问题 When invoking an XSL transform using Saxon from my application I receive the following error Static error at xsl:import on line 34 column 45 XTSE0210: A stylesheet cannot import itself Static error at xsl:import on line 42 column 39 XTSE0165: Reported 1 error in imported stylesheet module Static error in {leg:IsCurrentWelsh(/)} in expression in xsl:when/@test on line 101 column 43 XPST0017: Cannot find a 1-argument function named . . . net.sf.saxon.trans.XPathException: Errors were reported

SaxonJS unusable with webpack

左心房为你撑大大i 提交于 2021-02-11 13:36:28
问题 I'm running into an issue when trying to integrate SaxonJS into a larger web application using webpack . From what I can tell, webpack views SaxonJS as just another module, but SaxonJS is not structured as an AMD or CommonJS module. Instead, the Big.js (a SaxonJS dependency) hijacks the export. I believe that fixing Node.js support will also fix this issue. import * as SaxonJS from "./Saxon-JS/SaxonJS.js"; export class Transformer { public static transform(inputStr: string, sefFile: string,

How do I open a JSON file in Saxon 10.1?

非 Y 不嫁゛ 提交于 2021-02-11 12:28:43
问题 Following the instructions in the Saxonica documentation I have code that works great for opening an XML file. But when I use that same code to open a JSON file I get: Caused by: net.sf.saxon.s9api.SaxonApiException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:360) at net.windward.datasource.xml.SaxonDataSource.ctor(SaxonDataSource.java:231) at net.windward.datasource.xml

What happened to com.saxonica.ptree.StylesheetPackager in Saxonica 9.7.0.4?

落爺英雄遲暮 提交于 2021-02-11 04:23:02
问题 I'm trying to upgrade Saxonica PE from 9.6.0.8 to 9.7.0.4 but can't proceed until I find a suitable replacement for StylesheetPackager. I've looked but haven't found anything yet. The class went missing in 9.7.0.1. 回答1: We completely redesigned the mechanism for stylesheet packaging in 9.7. Exporting a stylesheet now works at the level of a "package" rather than a complete stylesheet (though it can be a complete stylesheet of course), and the export file contains an encoding of the compiled

What happened to com.saxonica.ptree.StylesheetPackager in Saxonica 9.7.0.4?

放肆的年华 提交于 2021-02-11 04:22:47
问题 I'm trying to upgrade Saxonica PE from 9.6.0.8 to 9.7.0.4 but can't proceed until I find a suitable replacement for StylesheetPackager. I've looked but haven't found anything yet. The class went missing in 9.7.0.1. 回答1: We completely redesigned the mechanism for stylesheet packaging in 9.7. Exporting a stylesheet now works at the level of a "package" rather than a complete stylesheet (though it can be a complete stylesheet of course), and the export file contains an encoding of the compiled

How to run saxon xslt transformation in java

十年热恋 提交于 2021-02-07 06:34:27
问题 I can easily run the following in command line to transform an xml file: java -jar saxon9he.jar -o:outputfile.xml data.xml transform.xslt I would like to do the exact same results from within a java file so I can use it in part of a program I'm making. I have put the saxon9he.jar in the build path but how can I call that same command outside the commandline? 回答1: The documentation is here: http://www.saxonica.com/documentation/index.html#!using-xsl/embedding Saxon offers two APIs for running

dependency graph traversal in XSLT for copying related elements of an XML model

孤街浪徒 提交于 2021-01-29 17:34:52
问题 I want to demonstrate XSL powerfullness for data exploration by solving the following problem: Given an xml file that describes some kind of "entity-relashionship" model, and for one entity in that model given by a name (assuming an attribute of the XML schema is used as identifier), I want a transformation that produce a new XML model that contains the given entity, plus all of its relatives as per the "Transitive closure of the dependencies relationship" of that given entity. For example,

A better way to use streaming in XSLT 3.0

可紊 提交于 2021-01-29 13:58:55
问题 A document I am trying to transform using streaming have the structure as follows <Document> <Header> <Number>23</Number> <Type>3</Type> </Header> <Lines> <Line> <LineNumber>1</LineNumber> </Line> <Line> <LineNumber>2</LineNumber> </Line> </Lines> <Summary> <Total>42</Total> </Summary> </Document> The real output should have more complex structure, but for the moment I simplified it to just having a different naming <Transformed> <DocumentHeader> <DocumentNumber>23</DocumentNumber>

Getting the serialization properties from Saxon transformation

為{幸葍}努か 提交于 2021-01-29 13:16:46
问题 I have following XSL stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"> <xsl:output encoding="UTF-8" method="xml"/> <xsl:template match="/"> <test/> </xsl:template> </xsl:stylesheet> I am using Saxon 9.9 to transform it like this. public String transform(InputStream input, InputStream stylesheet, OutputStream output){ Processor p = new Processor(false); XsltCompiler c = p.newXsltCompiler(); XsltExecutable e = c