Skip to content
Commits on Source (3)
saxonhe (9.9.0.1+dfsg-1) unstable; urgency=medium
* New upstream release.
* Update Java source and target to 1.8
* Add patch to remove debugging
* Bump Standards-Version to 4.2.1.3
* Remove get-orig-source target from d/rules
-- Eugene Zhukov <eugene@debian.org> Thu, 25 Oct 2018 21:52:08 +0300
saxonhe (9.8.0.14+dfsg-1) unstable; urgency=medium
* New upstream release.
......
......@@ -15,8 +15,8 @@ Build-Depends: debhelper (>= 11),
libcommons-io-java,
libintellij-annotations-java,
libicu4j-java
Standards-Version: 4.1.4
Vcs-Git: https://salsa.debian.org/java-team/saxonhe
Standards-Version: 4.2.1.3
Vcs-Git: https://salsa.debian.org/java-team/saxonhe.git
Vcs-Browser: https://salsa.debian.org/java-team/saxonhe
Homepage: http://www.saxonica.com/
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Saxon-HE
Source: http://www.saxonica.com/
Comment: Tarball is repacked to remove folder with inappropriate license
Files: *
Copyright: 1999-2014, Saxonica
......@@ -20,7 +21,9 @@ Files: debian/*
Copyright: 2013, Eugene Zhukov <eugene@debian.org>
License: MPL-2.0
Files: data/analyze-string.xsd data/json.xsd data/xpath-functions.xsd
Files: net/sf/saxon/data/analyze-string.xsd
net/sf/saxon/data/json.xsd
net/sf/saxon/data/xpath-functions.xsd
Copyright: 1994-2002 World Wide Web Consortium
License: W3C-SOFTWARE-NOTICE-AND-LICENSE
......
Description: Adds pom.xml for building
* The pom.xml created for packaging purposes
Author: Eugene Zhukov <jevgeni.zh@gmail.com>
Last-Update: 2014-09-14
Description: Add pom.xml for building and packaging
--- /dev/null
+++ b/pom.xml
......@@ -11,7 +8,7 @@ Last-Update: 2014-09-14
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>Saxon-HE</artifactId>
+ <version>9.8.0.14</version>
+ <version>9.9.0.1</version>
+ <packaging>jar</packaging>
+ <name>Saxon-HE</name>
+ <description>The XSLT and XQuery Processor</description>
......@@ -74,8 +71,8 @@ Last-Update: 2014-09-14
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <encoding>ISO-8859-1</encoding>
+ <source>1.6</source>
+ <target>1.6</target>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
......
Description: Remove SaxonCAPI.debug statements
--- saxonhe-9.9.0.1+dfsg.orig/net/sf/saxon/jetonnet/JetPullProvider.java
+++ saxonhe-9.9.0.1+dfsg/net/sf/saxon/jetonnet/JetPullProvider.java
@@ -6,7 +6,6 @@ import net.sf.saxon.expr.parser.Explicit
import net.sf.saxon.expr.parser.Location;
import net.sf.saxon.lib.ParseOptions;
import net.sf.saxon.om.*;
-import net.sf.saxon.option.cpp.SaxonCAPI;
import net.sf.saxon.pull.PullProvider;
import net.sf.saxon.pull.PullSource;
import net.sf.saxon.pull.UnparsedEntity;
@@ -40,9 +39,6 @@ public class JetPullProvider implements
public JetPullProvider(Object parser, long parserPtr, String bURI) {
- if (SaxonCAPI.debug) {
- System.err.println("Java: Parser pointer long value="+parserPtr);
- }
this.parser = parser;
this.parserPtr = parserPtr;
this.parserPtrInt = (int)parserPtr;
@@ -111,9 +107,6 @@ public class JetPullProvider implements
@Override
public int next() throws XPathException {
- if (SaxonCAPI.debug) {
- System.err.println("Java: next(), current = " + current + " empty: " + isEmptyElement);
- }
if (current == START_OF_INPUT) {
current = START_DOCUMENT;
return current;
@@ -145,9 +138,6 @@ public class JetPullProvider implements
int intype = get_NodeType(parserPtr);
isEmptyElement = get_IsEmptyElement(parserPtr);
- if (SaxonCAPI.debug) {
- System.err.println("Java: Next event: " + intype + " at depth " + get_Depth(parserPtr) + " empty: " + isEmptyElement + "," + get_IsEmptyElement(parserPtr));
- }
if (get_EOF(parserPtr)) {
current = END_DOCUMENT;
return current;
@@ -251,9 +241,6 @@ public class JetPullProvider implements
String namespaceURI = result.substring(result.indexOf("{") + 1, closingBracket);
String localName = result.substring(closingBracket + 1, valueIndex);
String value = result.substring(valueIndex + 1);
- if (SaxonCAPI.debug) {
- System.err.println("Java: getNodeName prefix= " + prefix + ", namespace=" + namespaceURI + ", localName=" + localName + " value=" + value);
- }
NodeName nc = new FingerprintedQName(prefix, namespaceURI, localName);
// .NET does not report the attribute type (even if it's an ID...)
atts.addAttribute(nc, BuiltInAtomicType.UNTYPED_ATOMIC, value, ExplicitLocation.UNKNOWN_LOCATION, 0);
@@ -289,9 +276,6 @@ public class JetPullProvider implements
String prefix = result.substring(0, openingBracket);
String namespaceURI = result.substring(result.indexOf("{") + 1, closingBracket);
String localName = result.substring(closingBracket + 1);
- if (SaxonCAPI.debug) {
- System.err.println("Java: getNodeName prefix= " + prefix + ", namespace=" + namespaceURI + ", localName=" + localName);
- }
return new FingerprintedQName(prefix, namespaceURI, localName);
}
--- saxonhe-9.9.0.1+dfsg.orig/net/sf/saxon/jetonnet/JetStream.java
+++ saxonhe-9.9.0.1+dfsg/net/sf/saxon/jetonnet/JetStream.java
@@ -3,7 +3,6 @@ package net.sf.saxon.jetonnet;
import net.sf.saxon.Configuration;
import net.sf.saxon.lib.ParseOptions;
import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.option.cpp.SaxonCAPI;
import net.sf.saxon.pull.PullSource;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.XdmNode;
pom_added.patch
remove_debug.patch
......@@ -2,6 +2,3 @@
%:
dh $@ --buildsystem=maven
get-orig-source:
uscan --verbose --download-current-version --force-download --rename --no-symlink
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -19,16 +19,13 @@ import net.sf.saxon.jaxp.SaxonTransformerFactory;
* file. This is therefore the recommended factory to use if you want to be sure
* that an application will run successfully under Saxon-HE, and will fail if it attempts to
* use Saxon-PE or Saxon-EE facilities.</p>
* <p/>
* <p>The system property that determines which Factory implementation
* to create is named "javax.xml.transform.TransformerFactory". This
* property names a concrete subclass of the TransformerFactory abstract
* class. If the property is not defined, a platform default is be used.</p>
* <p/>
* <p>This implementation class implements the abstract methods on both the
* javax.xml.transform.TransformerFactory and javax.xml.transform.sax.SAXTransformerFactory
* classes.</p>
* <p/>
* <p>This class is the "public" implementation of the TransformerFactory
* interface for Saxon-HE. It is a trivial subclass of the internal class
* {@link SaxonTransformerFactory}, which is in a separate package
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -196,7 +196,7 @@ public interface Platform {
*
* @param edition The edition of the software that is loaded ("HE", "PE", or "EE")
* @param config the Saxon configuration
* @return the name of the directory in which Saxon is installaed, if available, or null otherwise
* @return the name of the directory in which Saxon is installed, if available, or null otherwise
*/
String getInstallationDirectory(String edition, Configuration config);
......@@ -205,6 +205,7 @@ public interface Platform {
* Register all the external object models that are provided as standard
* with the relevant edition of Saxon for this Configuration
*
* @param config the Saxon configuration
* @since 9.3
*/
......@@ -215,6 +216,7 @@ public interface Platform {
* Needed because the Apache catalog resolver uses the SAXParserFactory to instantiate
* a parser, and if not customized this causes a failure on the .NET platform.
*
* @param config the Saxon configuration
* @since 9.4
*/
......@@ -236,6 +238,7 @@ public interface Platform {
/**
* Make an instance of the default module URI resolver for this platform
* @param config the Saxon configuration
* @return an instance of ModuleURIResolver
* @since 9.7.0.2
*/
......@@ -253,7 +256,7 @@ public interface Platform {
* @since 9.6.0.3
*/
ClassLoader makeClassLoader(Configuration config, Class thisClass);
ClassLoader makeGeneratedClassLoader(Configuration config, Class thisClass);
//#endif
}
......
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -16,12 +16,14 @@ import net.sf.saxon.functions.FunctionLibraryList;
import net.sf.saxon.lib.NamespaceConstant;
import net.sf.saxon.lib.OutputURIResolver;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.serialize.SerializationProperties;
import net.sf.saxon.style.Compilation;
import net.sf.saxon.style.StylesheetPackage;
import net.sf.saxon.trace.ExpressionPresenter;
import net.sf.saxon.trans.CompilerInfo;
import net.sf.saxon.trans.SymbolicName;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.trans.XsltController;
import net.sf.saxon.trans.rules.RuleManager;
import java.net.URI;
......@@ -109,20 +111,12 @@ public class PreparedStylesheet extends Executable {
* @see net.sf.saxon.Controller
*/
public Controller newController() {
public XsltController newController() {
Configuration config = getConfiguration();
Controller c = new Controller(config, this);
XsltController c = new XsltController(config, this);
c.setMessageReceiverClassName(messageReceiverClassName);
c.setOutputURIResolver(outputURIResolver);
c.setRecoveryPolicy(recoveryPolicy);
if (defaultInitialTemplate != null) {
try {
c.setInitialTemplate(defaultInitialTemplate);
} catch (XPathException err) {
// ignore error if there is no template with this name
}
}
if (defaultInitialMode != null) {
try {
c.setInitialMode(defaultInitialMode);
......@@ -194,11 +188,19 @@ public class PreparedStylesheet extends Executable {
public void putNamedTemplate(StructuredQName templateName, NamedTemplate template) {
if (namedTemplateTable == null) {
namedTemplateTable = new HashMap<StructuredQName, NamedTemplate>(32);
namedTemplateTable = new HashMap<>(32);
}
namedTemplateTable.put(templateName, template);
}
/**
* Get the default initial template name
*/
public StructuredQName getDefaultInitialTemplateName() {
return defaultInitialTemplate;
}
/**
* Register the index of components
*
......@@ -252,18 +254,13 @@ public class PreparedStylesheet extends Executable {
}
/**
* Get the properties for xsl:output. JAXP method. The object returned will
* Get the properties for xsl:output, including character maps. The object returned will
* be a clone of the internal values, and thus it can be mutated
* without mutating the Templates object, and then handed in to
* the process method.
* <p>In Saxon, the properties object is a new, empty, Properties object that is
* backed by the live properties to supply default values for missing properties.
* This means that the property values must be read using the getProperty() method.
* Calling the get() method on the underlying Hashtable will return null.</p>
* <p>In Saxon 8.x, this method gets the output properties for the unnamed output
* without affecting the value held in this {@code PreparedStylesheet}.
* <p>This method gets the output properties for the unnamed output
* format in the stylesheet.</p>
*
* @return A Properties object reflecting the output properties defined
* @return An OutputProperties object reflecting the output properties defined
* for the default (unnamed) output format in the stylesheet. It may
* be mutated and supplied to the setOutputProperties() method of the
* Transformer, without affecting other transformations that use the
......@@ -271,10 +268,9 @@ public class PreparedStylesheet extends Executable {
* @see javax.xml.transform.Transformer#setOutputProperties
*/
public Properties getOutputProperties() {
Properties details = getDefaultOutputProperties();
return new Properties(details);
public SerializationProperties getDeclaredSerializationProperties() {
SerializationProperties details = getPrimarySerializationProperties();
return new SerializationProperties(new Properties(details.getProperties()), getCharacterMapIndex());
}
/**
......@@ -318,7 +314,7 @@ public class PreparedStylesheet extends Executable {
}
if (abs != null) {
if (nextStylesheetCache == null) {
nextStylesheetCache = new HashMap<URI, PreparedStylesheet>(4);
nextStylesheetCache = new HashMap<>(4);
}
nextStylesheetCache.put(abs, pss);
}
......@@ -341,7 +337,7 @@ public class PreparedStylesheet extends Executable {
explainNamedTemplates(presenter);
presenter.startElement("accumulators");
for (Accumulator acc : getTopLevelPackage().getAccumulatorRegistry().getAllAccumulators()) {
((Actor)acc).export(presenter);
acc.export(presenter);
}
presenter.endElement();
FunctionLibraryList libList = getFunctionLibrary();
......
This diff is collapsed.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -13,6 +13,7 @@ import net.sf.saxon.lib.*;
import net.sf.saxon.s9api.*;
import net.sf.saxon.style.StylesheetPackage;
import net.sf.saxon.trace.AbstractTraceListener;
import net.sf.saxon.trace.Instrumentation;
import net.sf.saxon.trace.TimingCodeInjector;
import net.sf.saxon.trace.TimingTraceListener;
import net.sf.saxon.trans.CommandLineOptions;
......@@ -39,15 +40,15 @@ import java.util.*;
/**
* This <b>Transform</b> class is the command-line entry point to the Saxon XSLT Processor.
* <p/>
* <p>It is possible to subclass this class to provide a customized command line interface. In writing such
* a subclass:</p>
* <p/>
* <ul>
* <li>The {@link #main} method should instantiate the class and call the {@link #doTransform} method, passing the
* argument list. The argument list can be augmented or modified if required: for example, by adding a -config
* argument to cause the configuration to be initialized from a configuration file.</li>
* <li>The {@link #setFactoryConfiguration} method can be implemented
* <li>The {@link #initializeConfiguration} method can be implemented to customize the configuration in which
* the transformation will run.</li>
* </ul>
*/
public class Transform {
......@@ -64,8 +65,8 @@ public class Transform {
/**
* Main program, can be used directly from the command line.
* <p>The format is:</P>
* <p>java net.sf.saxon.Transform [options] <I>source-file</I> <I>style-file</I> &gt;<I>output-file</I></P>
* <p>The format is:</p>
* <p>java net.sf.saxon.Transform [options] <I>source-file</I> <I>style-file</I> &gt;<I>output-file</I></p>
* <p>followed by any number of parameters in the form {keyword=value}... which can be
* referenced from within the stylesheet.</p>
* <p>This program applies the XSL style sheet in style-file to the source XML document in source-file.</p>
......@@ -135,7 +136,7 @@ public class Transform {
options.addRecognizedOption("o", CommandLineOptions.TYPE_FILENAME | CommandLineOptions.VALUE_REQUIRED,
"Use specified file for primary output");
options.addRecognizedOption("opt", CommandLineOptions.TYPE_STRING | CommandLineOptions.VALUE_REQUIRED,
"Enable/disable optimization options [-]cfgklmsvwx");
"Enable/disable optimization options [-]cfgjklmrsvwx");
options.addRecognizedOption("or", CommandLineOptions.TYPE_CLASSNAME | CommandLineOptions.VALUE_REQUIRED,
"Use named OutputURIResolver class");
options.addRecognizedOption("outval", CommandLineOptions.TYPE_ENUMERATION | CommandLineOptions.VALUE_REQUIRED,
......@@ -355,7 +356,7 @@ public class Transform {
String value = options.getOptionValue("explain");
if (value != null) {
explain = true;
processor.setConfigurationProperty(FeatureKeys.TRACE_OPTIMIZER_DECISIONS, true);
processor.setConfigurationProperty(Feature.TRACE_OPTIMIZER_DECISIONS, true);
jit = false;
compiler.setJustInTimeCompilation(jit);
if (!"".equals(value)) {
......@@ -384,8 +385,12 @@ public class Transform {
value = options.getOptionValue("jit");
if (value != null) {
if ("on".equals(value) && exportOutputFileName == null && run) {
//TODO the combination of the options jit, nogo and export should give an warning
jit = true;
if (export) {
jit = false;
System.err.println("Warning: -jit:on is ignored when -export:on is set");
} else {
jit = true;
}
} else if ("off".equals(value)) {
jit = false;
}
......@@ -396,7 +401,7 @@ public class Transform {
value = options.getOptionValue("lib");
if (value != null) {
StringTokenizer st = new StringTokenizer(value, File.pathSeparator);
Set<File> packs = new HashSet<File>();
Set<File> packs = new HashSet<>();
while (st.hasMoreTokens()) {
String n = st.nextToken();
packs.add(new File(n));
......@@ -417,6 +422,10 @@ public class Transform {
value = options.getOptionValue("nogo");
if (value != null) {
if (jit) {
jit = false;
System.err.println("Warning: -jit:on is ignored when -nogo is set");
}
run = false;
compiler.setJustInTimeCompilation(false);
}
......@@ -450,7 +459,7 @@ public class Transform {
if (value != null) {
System.err.println(config.getProductTitle());
System.err.println(Version.platform.getPlatformVersion());
processor.setConfigurationProperty(FeatureKeys.TIMING, true);
processor.setConfigurationProperty(Feature.TIMING, true);
showTime = true;
}
......@@ -461,8 +470,8 @@ public class Transform {
} else {
traceListener = config.makeTraceListener(value);
}
processor.setConfigurationProperty(FeatureKeys.TRACE_LISTENER, traceListener);
processor.setConfigurationProperty(FeatureKeys.LINE_NUMBERING, true);
processor.setConfigurationProperty(Feature.TRACE_LISTENER, traceListener);
processor.setConfigurationProperty(Feature.LINE_NUMBERING, true);
value = options.getOptionValue("Tlevel");
if (value != null && traceListener instanceof AbstractTraceListener) {
......@@ -481,14 +490,14 @@ public class Transform {
value = options.getOptionValue("TB");
if (value != null) {
// Trace hotspot byte code generation and produce a report.
config.setBooleanProperty(FeatureKeys.MONITOR_HOT_SPOT_BYTE_CODE, true);
config.setBooleanProperty(Feature.MONITOR_HOT_SPOT_BYTE_CODE, true);
}
value = options.getOptionValue("TP");
if (value != null) {
traceListener = new TimingTraceListener();
processor.setConfigurationProperty(FeatureKeys.TRACE_LISTENER, traceListener);
processor.setConfigurationProperty(FeatureKeys.LINE_NUMBERING, true);
processor.setConfigurationProperty(Feature.TRACE_LISTENER, traceListener);
processor.setConfigurationProperty(Feature.LINE_NUMBERING, true);
compiler.getUnderlyingCompilerInfo().setCodeInjector(new TimingCodeInjector());
if (value.length() > 0) {
traceListener.setOutputDestination(
......@@ -522,7 +531,7 @@ public class Transform {
value = options.getOptionValue("x");
if (value != null) {
sourceParserName = value;
processor.setConfigurationProperty(FeatureKeys.SOURCE_PARSER_CLASS, sourceParserName);
processor.setConfigurationProperty(Feature.SOURCE_PARSER_CLASS, sourceParserName);
}
value = options.getOptionValue("xsd");
......@@ -532,7 +541,7 @@ public class Transform {
value = options.getOptionValue("xsdversion");
if (value != null) {
processor.setConfigurationProperty(FeatureKeys.XSD_VERSION, value);
processor.setConfigurationProperty(Feature.XSD_VERSION, value);
}
value = options.getOptionValue("xsl");
......@@ -543,7 +552,7 @@ public class Transform {
value = options.getOptionValue("y");
if (value != null) {
styleParserName = value;
processor.setConfigurationProperty(FeatureKeys.STYLE_PARSER_CLASS, value);
processor.setConfigurationProperty(Feature.STYLE_PARSER_CLASS, value);
}
value = options.getOptionValue("?");
......@@ -701,7 +710,11 @@ public class Transform {
if (sheet == null) {
for (int j = 0; j < repeat; j++) {
int repeatComp = repeat;
if (repeatComp > 20) {
repeatComp = 20;
}
for (int j = 0; j < repeatComp; j++) {
// Repeat loop is to get reliable performance data
options.applyStaticParams(compiler);
......@@ -735,7 +748,7 @@ public class Transform {
out.setOutputProperty(Serializer.Property.METHOD, "xml");
out.setOutputProperty(Serializer.Property.INDENT, "yes");
out.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes");
if (!"HE".equals(processor.getSaxonEdition())) {
if (config.isLicensedFeature(Configuration.LicenseFeature.PROFESSIONAL_EDITION)) {
out.setOutputProperty(Serializer.Property.SAXON_INDENT_SPACES, "2");
}
sheet.explain(out);
......@@ -743,47 +756,51 @@ public class Transform {
if (export) {
sheet.export(new FileOutputStream(exportOutputFileName));
if (showTime) {
System.err.println("Stylesheet exported to: " + exportOutputFileName);
System.err.println("Stylesheet exported to: " + new File(exportOutputFileName).getAbsolutePath());
}
}
if (run) {
if (wholeDirectory) {
if ((threadCount > 0) && (sources.size() > 1)) {
if (threadCount > sources.size()) {
threadCount = sources.size();
}
//calculate sources per thread
int sourcesPerThread = (int) Math.floor(sources.size() / threadCount);
//split remainder of sources amongst rem threads
int rem = sources.size() % threadCount;
th = new TransformThread[threadCount];
// long elapsedTime = System.nanoTime();
for (int i = 0, j = 0, z = 0; i < sources.size(); j++, i += sourcesPerThread + z) {
z = j < rem ? 1 : 0; //split remainder of sources amongst rem threads
th[j] = new TransformThread(i, sheet, sources.subList(i, i + sourcesPerThread + z), outputFile, options, traceDestination);
th[j].start();
}
for (TransformThread aTh : th) {
aTh.join();
try {
if (wholeDirectory) {
if ((threadCount > 0) && (sources.size() > 1)) {
if (threadCount > sources.size()) {
threadCount = sources.size();
}
//calculate sources per thread
int sourcesPerThread = (int) Math.floor(sources.size() / threadCount);
//split remainder of sources amongst rem threads
int rem = sources.size() % threadCount;
th = new TransformThread[threadCount];
// long elapsedTime = System.nanoTime();
for (int i = 0, j = 0, z = 0; i < sources.size(); j++, i += sourcesPerThread + z) {
z = j < rem ? 1 : 0; //split remainder of sources amongst rem threads
th[j] = new TransformThread(i, sheet, sources.subList(i, i + sourcesPerThread + z), outputFile, options, traceDestination);
th[j].start();
}
for (TransformThread aTh : th) {
aTh.join();
}
// elapsedTime = System.nanoTime() - elapsedTime;
// System.out.println("Total Elapsed Time: "+elapsedTime/1e6 + "ms");
} else {
processDirectory(sources, sheet, outputFile, options, traceDestination);
}
// elapsedTime = System.nanoTime() - elapsedTime;
// System.out.println("Total Elapsed Time: "+elapsedTime/1e6 + "ms");
} else {
processDirectory(sources, sheet, outputFile, options, traceDestination);
Source source = sources == null || sources.isEmpty() ? null : sources.get(0);
processFile(source, sheet, outputFile, options, traceDestination);
}
} finally {
if (closeTraceDestination && traceDestination != null) {
traceDestination.close();
}
} else {
Source source = sources == null || sources.isEmpty() ? null : sources.get(0);
processFile(source, sheet, outputFile, options, traceDestination);
}
if (closeTraceDestination) {
traceDestination.close();
}
}
if (options.getOptionValue("TB")!=null) {
// report on hotspot bytecode generation
......@@ -951,7 +968,7 @@ public class Transform {
*/
private File makeOutputFile(File directory, String localName, XsltExecutable sheet) {
String mediaType = sheet.getUnderlyingCompiledStylesheet().getDefaultOutputProperties().getProperty(OutputKeys.MEDIA_TYPE);
String mediaType = sheet.getUnderlyingCompiledStylesheet().getPrimarySerializationProperties().getProperty(OutputKeys.MEDIA_TYPE);
String suffix = ".xml";
if ("text/html".equals(mediaType)) {
suffix = ".html";
......@@ -1008,7 +1025,7 @@ public class Transform {
transformer.newSerializer(System.out) :
transformer.newSerializer(outFile);
try {
options.setSerializationParams(serializer);
options.setSerializationProperties(serializer);
} catch (IllegalArgumentException e) {
quit(e.getMessage(), 2);
}
......@@ -1053,7 +1070,7 @@ public class Transform {
String now = options.getOptionValue("now");
if (now != null) {
try {
DateTimeValue currentDateTime = (DateTimeValue) DateTimeValue.makeDateTimeValue(
DateTimeValue currentDateTime = (DateTimeValue)DateTimeValue.makeDateTimeValue(
now, getConfiguration().getConversionRules()).asAtomic();
transformer.getUnderlyingController().setCurrentDateTime(currentDateTime);
} catch (XPathException e) {
......@@ -1177,25 +1194,27 @@ public class Transform {
traceDestination = null;
}
Xslt30Transformer transformer = newTransformer(sheet, options, traceDestination);
Serializer serializer =
outputFile == null ?
transformer.newSerializer(System.out) :
transformer.newSerializer(outputFile);
Serializer serializer;
if (outputFile == null) {
transformer.setBaseOutputURI(new File(System.getProperty("user.dir")).toURI().toASCIIString());
serializer = transformer.newSerializer(System.out);
}else {
serializer = transformer.newSerializer(outputFile);
}
try {
options.setSerializationParams(serializer);
options.setSerializationProperties(serializer);
} catch (IllegalArgumentException e) {
quit(e.getMessage(), 2);
}
boolean buildResultTree;
Properties props = serializer.getCombinedOutputProperties();
String buildTreeProperty = props.getProperty(SaxonOutputKeys.BUILD_TREE);
String buildTreeProperty = serializer.getOutputProperty(Serializer.Property.BUILD_TREE);
if ("yes".equals(buildTreeProperty)) {
buildResultTree = true;
} else if ("no".equals(buildTreeProperty)) {
buildResultTree = false;
} else {
String method = props.getProperty(OutputKeys.METHOD);
String method = serializer.getOutputProperty(Serializer.Property.METHOD);
buildResultTree = !("json".equals(method) || "adaptive".equals(method));
}
......@@ -1224,9 +1243,9 @@ public class Transform {
builder.setSchemaValidator(validator);
}
}
builder.setDTDValidation(getConfiguration().getBooleanProperty(FeatureKeys.DTD_VALIDATION));
builder.setDTDValidation(getConfiguration().getBooleanProperty(Feature.DTD_VALIDATION));
builder.setWhitespaceStrippingPolicy(sheet.getWhitespaceStrippingPolicy());
if (getConfiguration().getBooleanProperty(FeatureKeys.DTD_VALIDATION_RECOVERABLE)) {
if (getConfiguration().getBooleanProperty(Feature.DTD_VALIDATION_RECOVERABLE)) {
source = new AugmentedSource(source, getConfiguration().getParseOptions());
}
XdmNode node = builder.build(source);
......@@ -1272,6 +1291,10 @@ public class Transform {
System.err.println("-------------------------------");
Runtime.getRuntime().gc();
}
if (Instrumentation.ACTIVE) {
Instrumentation.report();
Instrumentation.reset();
}
}
if (repeat == 999999 && totalTime > 60000) {
break;
......
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -13,7 +13,6 @@ import net.sf.saxon.jaxp.SaxonTransformerFactory;
/**
* A TransformerFactory instance can be used to create Transformer and Template
* objects.
* <p/>
* <p>This implementation of the JAXP TransformerFactory interface provides Saxon-HE,
* Saxon-PE, or Saxon-EE capability, depending on what software has been loaded from
* the classpath, and what license key is available.</p>
......@@ -25,17 +24,14 @@ import net.sf.saxon.jaxp.SaxonTransformerFactory;
* to create is named "javax.xml.transform.TransformerFactory". This
* property names a concrete subclass of the TransformerFactory abstract
* class. If the property is not defined, a platform default is be used.</p>
* <p/>
* <p>This implementation class implements the abstract methods on both the
* javax.xml.transform.TransformerFactory and javax.xml.transform.sax.SAXTransformerFactory
* classes.</p>
* <p/>
* <p>Since Saxon 9.6, the JAXP transformation interface is re-implemented as a layer
* on top of the s9api interface. This will affect applications that attempt to
* down-cast from JAXP interfaces to the underlying implementation classes.</p>
* <p/>
* <p>This class is the "public" implementation of the TransformerFactory
* interface for Saxon-HE. It is a trivial subclass of the internal class
* <p>This class is Saxon's "public" implementation of the TransformerFactory
* interface. It is a trivial subclass of the internal class
* {@link net.sf.saxon.jaxp.SaxonTransformerFactory}, which is in a separate package
* along with the implementation classes to which it has protected access.</p>
*/
......
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -13,11 +13,11 @@ package net.sf.saxon;
public final class Version {
private static final int[] STRUCTURED_VERSION = {9, 8, 0, 14};
private static final String VERSION = "9.8.0.14";
private static final String BUILD = "072511"; //mmddhh
private static final String RELEASE_DATE = "2018-07-25"; //yyy-mm-dd
private static final String MAJOR_RELEASE_DATE = "2017-06-08";
private static final int[] STRUCTURED_VERSION = {9, 9, 0, 1};
private static final String VERSION = "9.9.0.1";
private static final String BUILD = "092715"; //mmddhh
private static final String RELEASE_DATE = "2018-09-27";
private static final String MAJOR_RELEASE_DATE = "2018-09-27";
private Version() {
// class is never instantiated
......@@ -169,7 +169,7 @@ public final class Version {
platform = new com.saxonica.config.JavaPlatformPE();
//#endif
//#if EE==true && SAXONC != true
platform = new com.saxonica.config.JavaPlatformEE();
platform = new com.saxonica.config.JavaPlatformEE();
//#endif
//#endif
}
......
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:f="http://saxonica.com/ns/profile-functions"
exclude-result-prefixes="xs"
expand-text="yes"
version="3.0">
<xsl:param name="lang" as="xs:string" static="yes" required="yes"/>
<xsl:variable name="process" as="xs:string" static="yes" select="if ($lang = 'XSLT') then 'Stylesheet' else 'Query'"/>
<xsl:variable name="templateOr" select="if ($lang = 'XSLT') then 'template, ' else ''"/>
<xsl:variable name="templatesAnd" select="if ($lang = 'XSLT') then 'templates and ' else ''"/>
<xsl:variable name="style" as="xs:string" expand-text="no">
body {
background: #e4eef0;
}
h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14pt;
font-style: normal;
color: #3D5B96;
font-weight: bold;
}
h2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12pt;
font-style: normal;
color: #96433D;
font-weight: bold;
}
p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9pt;
font-style: normal;
color: #3D5B96;
font-weight: normal;
line-height: 1.3em;
padding-right:15px;
}
table {
border-collapse: collapse;
border: 1px solid black;
}
th, td {
border: 1px solid black;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9pt;
font-style: normal;
color: #3D5B96;
text-decoration: none;
line-height: 1.3em;
padding-left: 15px;
text-indent: -15px;
padding-right: 15px;
padding-top: 0px;
padding-bottom: 0px;
}
th {
background: #B1CCC7;
font-weight: bold;
}
td {
font-weight: normal;
}
</xsl:variable>
<xsl:template match="*">
<html>
<head>
<title>Analysis of {$process} + Execution Time</title>
<style>{$style}</style>
</head>
<body>
<h1>Analysis of {$process} Execution Time</h1>
<p>Total time: {format-number(@t-total, "#0.000")} milliseconds</p>
<h2>Time spent in each {$templateOr} function or global variable:</h2>
<p>The table below is ordered by the total net time spent in the {$templateOr}
function or global variable. Gross time means the time including called
{$templatesAnd} functions (recursive calls only count from the original entry);
net time means time excluding time spent in called {$templatesAnd} functions.</p>
<table>
<thead>
<tr>
<th>module</th>
<th>line</th>
<th>instruction</th>
<th>count</th>
<th>average time (gross/ms)</th>
<th>total time (gross/ms)</th>
<th>average time (net/ms)</th>
<th>total time (net/ms)</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="fn">
<xsl:sort select="number(@t-sum-net)" order="descending"/>
<tr>
<td><a href="{@file}">{tokenize(@file, '/')[last()]}</a></td>
<td align="right">{@line}</td>
<td>{@construct, @name, @match}</td>
<td align="right">{format-number(@count, ',##0')}</td>
<td align="right">{format-number(@t-avg, '#0.000')}</td>
<td align="right">{format-number(@t-sum, ',##0.000')}</td>
<td align="right">{format-number(@t-avg-net, '#0.000')}</td>
<td align="right">{format-number(@t-sum-net, ',##0.000')}</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:j="http://www.w3.org/2005/xpath-functions"
targetNamespace="http://www.w3.org/2005/xpath-functions">
......
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Saxonica Limited.
// Copyright (c) 2018 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
......@@ -86,7 +86,7 @@ public class AttrOverNodeInfo extends NodeOverNodeInfo implements Attr {
*/
public NodeList getChildNodes() {
List<Node> list = new ArrayList<Node>(1);
List<Node> list = new ArrayList<>(1);
list.add(getFirstChild());
return new DOMNodeList(list);
}
......