}
currProp.setAlias(false);
// Find the base path, look for the base schema and root node.
XMPAliasInfo info = XMPMetaFactory.getSchemaRegistry()
.findAlias(currProp.getName());
if (info != null)
{
// find or create schema
XMPNode baseSchema = XMPNodeUtils.findSchemaNode(tree, info
.getNamespace(), null, true);
baseSchema.setImplicit(false);
XMPNode baseNode = XMPNodeUtils
.findChildNode(baseSchema,
info.getPrefix() + info.getPropName(), false);
if (baseNode == null)
{
if (info.getAliasForm().isSimple())
{
// A top-to-top alias, transplant the property.
// change the alias property name to the base name
String qname = info.getPrefix() + info.getPropName();
currProp.setName(qname);
baseSchema.addChild(currProp);
// remove the alias property
propertyIt.remove();
}
else
{
// An alias to an array item,
// create the array and transplant the property.
baseNode = new XMPNode(info.getPrefix() + info.getPropName(), info
.getAliasForm().toPropertyOptions());
baseSchema.addChild(baseNode);
transplantArrayItemAlias (propertyIt, currProp, baseNode);
}
}
else if (info.getAliasForm().isSimple())
{
// The base node does exist and this is a top-to-top alias.
// Check for conflicts if strict aliasing is on.
// Remove and delete the alias subtree.
if (strictAliasing)
{
compareAliasedSubtrees (currProp, baseNode, true);
}
propertyIt.remove();
}
else
{
// This is an alias to an array item and the array exists.
// Look for the aliased item.
// Then transplant or check & delete as appropriate.
XMPNode itemNode = null;
if (info.getAliasForm().isArrayAltText())
{
int xdIndex = XMPNodeUtils.lookupLanguageItem(baseNode,
XMPConst.X_DEFAULT);
if (xdIndex != -1)
{