The only way I can get the version for ejb2.x descriptors is to get the doctype. I hacked in some support for this by adding an extended ContentHandler that supports the startDTD/endDTD from the SAX2 LexicalHandler:
interface DtdAwareContentHandler extends ContentHandler
{
public void startDTD(String name, String publicId, String systemId);
public void endDTD();
}
public class BookObjectFactory
implements ObjectModelFactory
{
// ObjectModelFactory implementation
public void startDTD(String name, String publicId, String systemId)
{
// Get version info from publicId...
}