}
}
- push_state(node, atts.getValue("type"), mode);
+ const char *type = atts.getValue("type");
+ if (type)
+ node->clearValue();
+ push_state(node, type, mode);
}
}
case SGPropertyNode::STRING:
return "string";
case SGPropertyNode::ALIAS:
- return "alias";
case SGPropertyNode::NONE:
return "unspecified";
}
// First, copy the actual value,
// if any.
if (in->hasValue()) {
- switch (in->getType(false)) {
+ switch (in->getType()) {
case SGPropertyNode::BOOL:
if (!out->setBoolValue(in->getBoolValue()))
retval = false;
if (!out->setUnspecifiedValue(in->getStringValue()))
retval = false;
break;
- case SGPropertyNode::ALIAS: {
- const char *path = in->getAliasTarget()->getPath();
- SGPropertyNode *node = out->getRootNode()->getNode(path, true);
- out->alias(node);
- break;
- }
default:
+ if (in->isAlias())
+ break;
string message = "Unknown internal SGPropertyNode type";
message += in->getType();
throw sg_error(message, "SimGear Property Reader");
}
}
+ // copy the attributes.
+ out->setAttributes( in->getAttributes() );
+
// Next, copy the children.
int nChildren = in->nChildren();
for (int i = 0; i < nChildren; i++) {