You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/11/22 16:30:54 UTC

svn commit: r478193 - /incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp

Author: robbinspg
Date: Wed Nov 22 07:30:53 2006
New Revision: 478193

URL: http://svn.apache.org/viewvc?view=rev&rev=478193
Log:
TUSCANY-907 Backing out Caroline's patch as it fails running SCA

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.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=478193&r1=478192&r2=478193
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Wed Nov 22 07:30:53 2006
@@ -540,29 +540,59 @@
                                 SDOSchemaSAX2Parser& schemaParser,
                                 SDOXMLString& schemaLocation)
         {
-            int i,j;
-			xmlChar *absoluteUri;
-
-			SDOXMLString sl = getCurrentFile();
-
-			/*
-			* Build an absolute URL using the current file as the base and
-			* the schemaLocation as the relative part, using the rules in
-			* RFC 2396 5.2. Resolving Relative References to Absolute Form
-			*/
-			try {
-				absoluteUri = xmlBuildURI((const xmlChar *)schemaLocation, (const xmlChar *)sl);
-				if (-1 != schemaParser.parse((const char *)absoluteUri)) {
-					xmlFree(absoluteUri);
-					return 1;
-				}
-			}
-			catch (SDORuntimeException e)
-			{
-			}
-			if (absoluteUri) xmlFree(absoluteUri);
-			
-			return 0;
+            int i,j,k;
+            SDOXMLString sl = getCurrentFile();
+          
+            i = sl.lastIndexOf('/');
+            j = sl.lastIndexOf('\\');
+            if ((j > i) || (i < 0))i=j;
+            if (i>=0)
+            {
+                sl = sl.substring(0,i+1) + schemaLocation;
+                try {
+                     if (-1 != schemaParser.parse((const char *)sl))
+                         return 1;
+                }
+                catch (SDORuntimeException e)
+                {
+                }
+                k = schemaLocation.lastIndexOf('/');
+                j = schemaLocation.lastIndexOf('\\');
+                if ((j > k) || (k < 0))k=j;
+                if (k>=0)
+                {
+                    sl = sl.substring(0,i+1) + schemaLocation.substring(0,k+1);
+                    try {
+                        if (-1 != schemaParser.parse((const char *)sl))
+                             return 1;
+                    }
+                    catch (SDORuntimeException e)
+                    {
+                    }
+                }
+            }
+            try {
+                if (-1 != schemaParser.parse((const char *)schemaLocation))
+                    return 1;
+            }
+            catch (SDORuntimeException e)
+            {
+            }
+            k = schemaLocation.lastIndexOf('/');
+            j = schemaLocation.lastIndexOf('\\');
+            if ((j > k) || (k < 0))k=j;
+            if (k>=0)
+            {
+                sl = schemaLocation.substring(0,k+1);
+                try {
+                    if (-1 != schemaParser.parse((const char *)sl))
+                        return 1;
+                }
+                catch (SDORuntimeException e)
+                {
+                }
+            }
+            return 0;
         }
 
 



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