xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r693484 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java
Date Tue, 09 Sep 2008 15:32:52 GMT
Author: mrglavas
Date: Tue Sep  9 08:32:52 2008
New Revision: 693484

URL: http://svn.apache.org/viewvc?rev=693484&view=rev
Log:
Fixing a couple compile errors on Java 1.3.1. String.split() wasn't introduced until Java
1.4.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java?rev=693484&r1=693483&r2=693484&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/XPath20.java
Tue Sep  9 08:32:52 2008
@@ -872,12 +872,13 @@
         private static boolean isBuiltInType(String qname, NamespaceContext context,
                 SymbolTable symbolTable) {
             boolean builtIn = false;
-            if (qname.indexOf(':') != -1) {
-                String[] qnameElements = qname.split(":");
-                String prefix = symbolTable.addSymbol(qnameElements[0]);
-                String uri = context.getURI(prefix);
+            final int colonIndex = qname.indexOf(':');
+            if (colonIndex != -1) {
+                final String prefix = symbolTable.addSymbol(qname.substring(0, colonIndex));
+                final String uri = context.getURI(prefix);
                 if (SchemaSymbols.URI_SCHEMAFORSCHEMA == uri) {
-                    XSSimpleType type = SchemaDVFactory.getInstance().getBuiltInType(qnameElements[1]);
+                    final String local = qname.substring(colonIndex + 1);
+                    XSSimpleType type = SchemaDVFactory.getInstance().getBuiltInType(local);
                     if (type != null) {
                         builtIn = true;
                     }
@@ -1736,8 +1737,12 @@
             int start = castExpr.indexOf(" cast as ", 0) + 9;
             int end = castExpr.indexOf(" ?", start);
             String qname = castExpr.substring(start, end);
-            String[] qnameElements = qname.split(":");
-            return (XSSimpleTypeDecl) SchemaDVFactory.getInstance().getBuiltInType(qnameElements[1]);
+            String local = qname;
+            int colonIndex = qname.indexOf(':');
+            if (colonIndex != -1) {
+                local = qname.substring(colonIndex + 1);
+            }
+            return (XSSimpleTypeDecl) SchemaDVFactory.getInstance().getBuiltInType(local);
         }
 
         private String getCastedValue(String castExpr) {



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


Mime
View raw message