Skip to content

Commit

Permalink
Compute Saxon version correctly, rearrange how the version message is…
Browse files Browse the repository at this point in the history
… printed so that the Saxon version can be included.
  • Loading branch information
ndw committed Jul 28, 2013
1 parent c8172a8 commit 05ac4ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/com/xmlcalabash/core/XProcConstants.java
Expand Up @@ -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 {
Expand All @@ -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!?");
}
Expand Down
4 changes: 3 additions & 1 deletion src/com/xmlcalabash/core/XProcRuntime.java
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/com/xmlcalabash/drivers/Main.java
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 05ac4ad

Please sign in to comment.