Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Xerces version

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Al Hopper <al AT logical-approach.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Xerces version
  • Date: Mon, 20 Dec 2004 18:33:17 -0500

Al Hopper wrote:

How would I verify, at runtime, that I'm using the right version of Xerces
in conjunction with Xom? The run-time environment is Suns JWSDP-1.1 with
Tomcat 4. I'd like to ensure that Xerces is being used and log the actual
versions to ensure that it's 2.6.2 (or later).



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
}



--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page