This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes logging version number at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "logging version number at runtime" Watch "logging version number at runtime" New topic
Author

logging version number at runtime

mohana konakanchi
Ranch Hand

Joined: May 16, 2001
Posts: 67
We have developement, staging, production environments which uses
apache xerces on each box. We had error while tranforming XML to HTML in staging and working fine in others (not able to trace the error message due to high volume data). Same code is deployed in all boxes.

Is there as way to know the version number of Xerces used on runtime? so that we can make sure different boxes running same version of Xerces.
mohana konakanchi
Ranch Hand

Joined: May 16, 2001
Posts: 67
I got this code from web.

You can use the org.apache.xerces.impl.Version class in Xerces. For
instance, this is the code that XOM's Builder class uses to check the
version:

try {
String versionString = Version.getVersion();
versionString = versionString.substring(9, 12);
xercesVersion = Double.valueOf(versionString).doubleValue();
}
catch (Exception ex) {
// The version string format changed so presumably it's
// 2.6 or later
}
catch (Error err) {
// Xerces not installed, so none of this matters
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logging version number at runtime
 
Similar Threads
Serialization SCJP KS && BB
Websphere and XML
CheckBoxes with same name
Java XML Validation Framework Alternative to Xerces
exception while running my first jdbc code