{
if (isExtension)
{
// System.out.println("Creating extension(1): "+uri);
elem = new ElemExtensionCall();
}
else if (isComponentDecl)
{
elem = (ElemTemplateElement) classObject.newInstance();
}
else if (isUnknownTopLevel)
{
// TBD: Investigate, not sure about this. -sb
elem = (ElemTemplateElement) classObject.newInstance();
}
else
{
elem = (ElemTemplateElement) classObject.newInstance();
}
elem.setDOMBackPointer(handler.getOriginatingNode());
elem.setLocaterInfo(handler.getLocator());
elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl);
if (elem instanceof ElemLiteralResult)
{
((ElemLiteralResult) elem).setNamespace(uri);
((ElemLiteralResult) elem).setLocalName(localName);
((ElemLiteralResult) elem).setRawName(rawName);
((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet(
isLREAsStyleSheet);
}
}
catch (InstantiationException ie)
{
handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie);
}
catch (IllegalAccessException iae)
{
handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae);
}
setPropertiesFromAttributes(handler, rawName, attributes, elem);
// bit of a hack here...
if (!isExtension && (elem instanceof ElemLiteralResult))
{
isExtension =
((ElemLiteralResult) elem).containsExtensionElementURI(uri);
if (isExtension)
{
// System.out.println("Creating extension(2): "+uri);
elem = new ElemExtensionCall();
elem.setLocaterInfo(handler.getLocator());
elem.setPrefixes(handler.getNamespaceSupport());
((ElemLiteralResult) elem).setNamespace(uri);
((ElemLiteralResult) elem).setLocalName(localName);