// We need to use the unnamespaced name in the command text since we'll be inserting this
// template into a file node that already has a namespace declaration.
TemplateNode clone;
boolean useAttrStyleForName = tn.getCommandText().contains("name=");
if (tn instanceof TemplateBasicNode) {
TemplateBasicNode tbn = (TemplateBasicNode) tn;
String derivedPartialName = (tn.getPartialTemplateName() != null) ?
derivedName.substring(soyFileHeaderInfo.namespace.length()) : null;
clone = new TemplateBasicNode(
cloneId, soyFileHeaderInfo, derivedName, derivedPartialName,
useAttrStyleForName, tbn.isOverride(), tn.isPrivate(),
tn.getAutoescapeMode(), tn.getContentKind(), tn.getSoyDoc(), tn.getSyntaxVersion());
if (! (derivedName.equals(clone.getTemplateName()) &&
Objects.equal(derivedPartialName, clone.getPartialTemplateName()))) {
throw new AssertionError();