]> git.mxchange.org Git - simgear.git/blobdiff - simgear/props/props_io.cxx
Harald JOHNSEN:
[simgear.git] / simgear / props / props_io.cxx
index e936f5b011f0fb6bab7f22abb350c33ea9fb8dfe..a4fe5a16e4b62c54f17440dec2b8877a1ddf66ac 100644 (file)
@@ -214,7 +214,10 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts)
       }
     }
 
-    push_state(node, atts.getValue("type"), mode);
+    const char *type = atts.getValue("type");
+    if (type)
+      node->clearValue();
+    push_state(node, type, mode);
   }
 }
 
@@ -483,7 +486,7 @@ writeNode (ostream &output, const SGPropertyNode * node,
   }
 
                                // If there are children, write them next.
-  if (nChildren > 0 || node->isAlias()) {
+  if (nChildren > 0) {
     doIndent(output, indent);
     output << '<' << name;
     writeAtts(output, node);
@@ -580,12 +583,17 @@ copyProperties (const SGPropertyNode *in, SGPropertyNode *out)
        retval = false;
       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++) {