Index: trunk/src/VBox/Main/include/ovfreader.h
===================================================================
--- trunk/src/VBox/Main/include/ovfreader.h	(revision 46140)
+++ trunk/src/VBox/Main/include/ovfreader.h	(revision 46169)
@@ -169,4 +169,8 @@
 };
 
+const char* const OVF09_URI_string = "http://www.vmware.com/schema/ovf/1/envelope";
+const char* const OVF10_URI_string = "http://schemas.dmtf.org/ovf/envelope/1";
+const char* const OVF20_URI_string = "http://schemas.dmtf.org/ovf/envelope/2";
+
 ////////////////////////////////////////////////////////////////////////////////
 //
@@ -176,17 +180,10 @@
 struct EnvelopeData
 {
-    RTCString version;//OVF standard version, it is used internally only by VirtualBox 
+    OVFVersion_T version;//OVF standard version, it is used internally only by VirtualBox 
     RTCString lang;//language
 
     OVFVersion_T getOVFVersion() const
     {
-        if (version == "0.9")
-            return OVFVersion_0_9;
-        else if (version == "1.0")
-            return OVFVersion_1_0;
-        else if (version == "2.0")
-            return OVFVersion_2_0;
-        else
-            return OVFVersion_unknown;
+            return version;
     }
 
@@ -194,12 +191,17 @@
     RTCString getStringOVFVersion() const
     {
-        if (version == "0.9")
+        if (version == OVFVersion_0_9)
             return "0.9";
-        else if (version == "1.0")
+        else if (version == OVFVersion_1_0)
             return "1.0";
-        else if (version == "2.0")
+        else if (version == OVFVersion_2_0)
             return "2.0";
         else
             return "";
+    }
+
+    void setOVFVersion(OVFVersion_T v)
+    {
+        version = v;
     }
 };
@@ -345,12 +347,13 @@
 struct VirtualDisk
 {
-    uint32_t            idController;           // SCSI (or IDE) controller this disk is connected to;
-                                                // this must match HardDiskController.idController and
-                                                // points into VirtualSystem.mapControllers
-    uint32_t            ulAddressOnParent;      // parsed strAddressOnParent of hardware item; will be 0 or 1 for IDE
-                                                // and possibly higher for disks attached to SCSI controllers (untested)
-    RTCString    strDiskId;              // if the hard disk has an ovf:/disk/<id> reference,
-                                                // this receives the <id> component; points to one of the
-                                                // references in Appliance::Data.mapDisks
+    uint32_t    idController;// SCSI (or IDE) controller this disk is connected to;
+                             // this must match HardDiskController.idController and
+                             // points into VirtualSystem.mapControllers
+    uint32_t    ulAddressOnParent;// parsed strAddressOnParent of hardware item; will be 0 or 1 for IDE
+                                  // and possibly higher for disks attached to SCSI controllers (untested)
+    RTCString   strDiskId;// if the hard disk has an ovf:/disk/<id> reference,
+                          // this receives the <id> component; points to one of the
+                          // references in Appliance::Data.mapDisks
+    bool        fEmpty;//true - empty disk, e.g. the component <rasd:HostResource>...</rasd:HostResource> is absent.
 };
 
Index: trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp	(revision 46140)
+++ trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp	(revision 46169)
@@ -709,13 +709,13 @@
     if (enFormat == ovf::OVFVersion_0_9)
     {
-        strNamespace = "http://www.vmware.com/schema/ovf/1/envelope";
+        strNamespace = ovf::OVF09_URI_string;
     }
     else if (enFormat == ovf::OVFVersion_1_0)
     {
-        strNamespace = "http://schemas.dmtf.org/ovf/envelope/1";
+        strNamespace = ovf::OVF10_URI_string;
     }
     else
     {
-        strNamespace = "http://schemas.dmtf.org/ovf/envelope/2";
+        strNamespace = ovf::OVF20_URI_string;
     }
 
Index: trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 46140)
+++ trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp	(revision 46169)
@@ -687,7 +687,4 @@
                                            di.ulSuggestedSizeMB,
                                            strExtraConfig);
-                    }//url specifier for VHD
-                    else if (!di.strFormat.compare("http://go.microsoft.com/fwlink/?LinkId=137171", Utf8Str::CaseInsensitive))
-                    {
                     }
                     else
Index: trunk/src/VBox/Main/xml/ovfreader.cpp
===================================================================
--- trunk/src/VBox/Main/xml/ovfreader.cpp	(revision 46140)
+++ trunk/src/VBox/Main/xml/ovfreader.cpp	(revision 46169)
@@ -67,22 +67,40 @@
     const xml::AttributeNode *pTypeAttr;
     const char *pcszTypeAttr = "";
-
-    if (    !pRootElem
-         || strcmp(pRootElem->getName(), "Envelope")
-       )
+    RTCString pcszNamespaceURI;
+
+    if (!pRootElem || strcmp(pRootElem->getName(), "Envelope"))
         throw OVFLogicError(N_("Root element in OVF file must be \"Envelope\"."));
 
-    if ((pTypeAttr = pRootElem->findAttribute("version")))
+    pcszNamespaceURI = pRootElem->getNamespaceURI();
+    if(pcszNamespaceURI.isEmpty())
     {
-        pcszTypeAttr = pTypeAttr->getValue();
-        m_envelopeData.version = pcszTypeAttr;
+        throw OVFLogicError(N_("Error reading namespace URI in 'Envelope' element, line %d"), pRootElem->getLineNumber());
+    }
+
+    if (strncmp(ovf::OVF20_URI_string, pcszNamespaceURI.c_str(), pcszNamespaceURI.length()) == 0)
+    {
+        m_envelopeData.setOVFVersion(ovf::OVFVersion_2_0);
+    }
+    else if (strncmp(OVF10_URI_string, pcszNamespaceURI.c_str(), pcszNamespaceURI.length()) == 0)
+    {
+        m_envelopeData.setOVFVersion(ovf::OVFVersion_1_0);
     }
     else
     {
+        m_envelopeData.setOVFVersion(ovf::OVFVersion_0_9);
+    }
+
+//    if ((pTypeAttr = pRootElem->findAttribute("version")))
+//    {
+//        pcszTypeAttr = pTypeAttr->getValue();
+//        m_envelopeData.version = pcszTypeAttr;
+//    }
+//    else
+//    {
 //        throw OVFLogicError(N_("Error reading \"%s\": missing or invalid attribute '%s' in 'Envelope' element, line %d"),
-//                            m_strPath.c_str(),
+//                           m_strPath.c_str(),
 //                            "version",
 //                            pRootElem->getLineNumber());
-    }
+//    }
 
     if ((pTypeAttr = pRootElem->findAttribute("xml:lang")))
