Permalink
Browse files

Compute Saxon version correctly, rearrange how the version message is…

… printed so that the Saxon version can be included.
  • Loading branch information...
ndw committed Jul 28, 2013
1 parent c8172a8 commit 05ac4ade95ee22dc6ae7d6f74daf185805a084e0
@@ -132,7 +132,6 @@ protected XProcConstants() {
}
private static String initializeVersion() {
- String sver = "(for Saxon 9.4.x)";
Properties config = new Properties();
InputStream stream = null;
try {
@@ -147,7 +146,7 @@ private static String initializeVersion() {
if (major == null || minor == null || release == null) {
throw new UnsupportedOperationException("Invalid version.properties in JAR file!?");
}
- return major + "." + minor + "." + release + " " + sver;
+ return major + "." + minor + "." + release;
} catch (IOException ioe) {
throw new UnsupportedOperationException("No version.properties in JAR file!?");
}
@@ -469,7 +469,9 @@ public String getProductName() {
}
public String getProductVersion() {
- return XProcConstants.XPROC_VERSION;
+ String sver = processor.getSaxonProductVersion();
+ String sed = processor.getUnderlyingConfiguration().getEditionCode();
+ return XProcConstants.XPROC_VERSION + " (for Saxon " + sver + "/" + sed + ")";
}
public String getVendor() {
@@ -93,10 +93,6 @@ public void run(String[] args) throws IOException {
try {
XProcConfiguration config = userArgs.createConfiguration();
- if (userArgs.isShowVersion()) {
- showVersion();
- }
-
if (run(userArgs, config)) {
// It's just sooo much nicer if there's a newline at the end.
System.out.println();
@@ -143,6 +139,10 @@ boolean run(UserArgs userArgs, XProcConfiguration config) throws SaxonApiExcepti
runtime = new XProcRuntime(config);
debug = config.debug;
+ if (userArgs.isShowVersion()) {
+ showVersion();
+ }
+
XPipeline pipeline = null;
if (userArgs.getPipeline() != null) {

0 comments on commit 05ac4ad

Please sign in to comment.