if (mDelegateHandler == null) {
// try to find out whether we should use the XCAS or XMI deserializers
// if there's an xmi:version attribute, always use XMI
String xmiVer = attributes.getValue("xmi:version");
if (xmiVer != null && xmiVer.length() > 0) {
XmiCasDeserializer deser = new XmiCasDeserializer(mCAS.getTypeSystem());
mDelegateHandler = deser.getXmiCasHandler(mCAS, mLenient);
} else if ("CAS".equals(localName)) // use XCAS
{
XCASDeserializer deser = new XCASDeserializer(mCAS.getTypeSystem());
mDelegateHandler = deser
.getXCASHandler(mCAS, mLenient ? new OutOfTypeSystemData() : null);
} else // default to XMI
{
XmiCasDeserializer deser = new XmiCasDeserializer(mCAS.getTypeSystem());
mDelegateHandler = deser.getXmiCasHandler(mCAS, mLenient);
}
mDelegateHandler.startDocument();
}
mDelegateHandler.startElement(uri, localName, qName, attributes);
}