Author: peter
Date: Sun Sep 20 16:22:24 2009
New Revision: 3451

Log:
temporarily suspend strictValidation until able to fix bug to properly resolve 
and load XSD schemas. In the meanwhile, add a check to at least validate EAD 
xml documents if doctype dtd declaration follows common practice of assuming 
dtd is located in local relative path

Modified:
   trunk/lib/QubitXmlImport.class.php

Modified: trunk/lib/QubitXmlImport.class.php
==============================================================================
--- trunk/lib/QubitXmlImport.class.php  Sun Sep 20 15:21:20 2009        (r3450)
+++ trunk/lib/QubitXmlImport.class.php  Sun Sep 20 16:22:24 2009        (r3451)
@@ -49,7 +49,7 @@
     $qubitXmlImport = new QubitXmlImport;
 
     // load the XML document into a DOMXML object
-    $importDOM = self::loadXML($xmlStream, $options);
+    $importDOM = self::loadXML($xmlStream, $options = array('strictXmlParsing' 
=> false));
 
     // if we were unable to parse the XML file at all
     if (empty($importDOM->documentElement))
@@ -113,6 +113,17 @@
       }
     }
 
+    // just validate EAD import for now until we can get StrictXMLParsing 
working for all schemas in the self::LoadXML function. Having problems right 
now loading schemas.
+    if ('ead' == $importSchema)
+    {
+      $importDOM->validate();
+      // if libxml threw errors, populate them to show in the template
+      foreach (libxml_get_errors() as $libxmlerror)
+      {
+        $qubitXmlImport->errors[] = 
sfContext::getInstance()->getI18N()->__('libxml error %code% on line %line% in 
input file: %message%', array('%code%' => $libxmlerror->code, '%message%' => 
$libxmlerror->message, '%line%' => $libxmlerror->line));
+      }
+    }
+
     $importMap = 
sfConfig::get('sf_app_module_dir').DIRECTORY_SEPARATOR.'object'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'import'.DIRECTORY_SEPARATOR.$importSchema.'.yml';
     if (!file_exists($importMap))
     {

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to