You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by gw...@apache.org on 2007/01/05 11:44:07 UTC

svn commit: r492974 - in /incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo: SDOSchemaSAX2Parser.cpp XSDHelperImpl.cpp

Author: gwinn
Date: Fri Jan  5 02:44:06 2007
New Revision: 492974

URL: http://svn.apache.org/viewvc?view=rev&rev=492974
Log:
TUSCANY-990 Update for Windows path names.

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp?view=diff&rev=492974&r1=492973&r2=492974
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Fri Jan  5 02:44:06 2007
@@ -546,6 +546,8 @@
         SDOSchemaSAX2Parser* ParserErrorSetter::parseIfNot(const void* location, bool loadImportNamespace, const void* base)
         {
             xmlChar*const absoluteUri = xmlBuildURI((xmlChar*)location, (xmlChar*)base);
+            if (! absoluteUri)
+                SDO_THROW_EXCEPTION("parseIfNot", SDOFileNotFoundException, (char*)location);
             LocationParserMap::iterator iter = parsedLocations.find(absoluteUri);
             if (parsedLocations.end() == iter)
             {

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp?view=diff&rev=492974&r1=492973&r2=492974
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp Fri Jan  5 02:44:06 2007
@@ -30,6 +30,7 @@
 #include <iostream>
 #include <fstream>
 #include <sstream>
+#include <libxml/uri.h>
 #include "commonj/sdo/SDOSchemaSAX2Parser.h"
 #include "commonj/sdo/SDOSAX2Parser.h"
 #include "commonj/sdo/XSDPropertyInfo.h"
@@ -80,7 +81,22 @@
         const char* XSDHelperImpl::defineFile(const char* schema, bool loadImportNamespace)
         {
             clearErrors();
-            SDOSchemaSAX2Parser*const schemaParser = parseIfNot(schema, loadImportNamespace);
+            SDOSchemaSAX2Parser* schemaParser;
+
+        /*  Build URI allowing for Windows path
+        */
+            xmlChar*const uri = xmlCanonicPath((xmlChar*)schema);
+            try
+            {
+                schemaParser = parseIfNot(uri, loadImportNamespace);
+            }
+            catch(...)
+            {
+                xmlFree(uri);
+                throw;
+            }
+            xmlFree(uri);
+
             if (schemaParser)
             {
                 defineTypes(schemaParser->getTypeDefinitions());



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org