Hi Mukul,

I noticed this change to NamespaceSupport in your commit. Is there a reason
why you're calling String.equals()? Prefixes and URIs are interned strings
across Xerces. They are compared using '==' for performance reasons.

See the comment at the top of the class:

/**
 * Namespace support for XML document handlers. This class doesn't
 * perform any error checking and assumes that all strings passed
 * as arguments to methods are unique symbols. The SymbolTable class
 * can be used for this purpose.
 */

This class is used in many places, most importantly by the XML scanner
itself. Can you change it back to using '=='?

Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/NamespaceSupport.java

URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/NamespaceSupport.java?rev=978885&r1=978884&r2=978885&view=diff

==============================================================================

---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/NamespaceSupport.java
 (original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/NamespaceSupport.java
 Sat Jul 24 15:46:09 2010
@@ -189,7 +189,7 @@ public class NamespaceSupport implements

         // find prefix in current context
         for (int i = fNamespaceSize; i > 0; i -= 2) {
-            if (fNamespace[i - 2] == prefix) {
+            if (prefix.equals(fNamespace[i - 2])) {
                 return fNamespace[i - 1];
             }
         }
@@ -207,8 +207,8 @@ public class NamespaceSupport implements

         // find uri in current context
         for (int i = fNamespaceSize; i > 0; i -= 2) {
-            if (fNamespace[i - 1] == uri) {
-                if (getURI(fNamespace[i - 2]) == uri)
+            if (uri.equals(fNamespace[i - 1])) {
+                if (uri.equals(getURI(fNamespace[i - 2])))
                     return fNamespace[i - 2];
             }
         }

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

Mukul Gandhi <[email protected]> wrote on 07/23/2010 08:34:37 AM:

> Hi all,
>     We already have vc:minVersion and vc:maxVersion attributes from
> schema versioning namespace
> (http://www.w3.org/2007/XMLSchema-versioning) implemented in XML
> Schema 1.1 implementation from Xerces.
>
> But I cannot find following attributes from vc: namespace implemented
> yet in Xerces-J:
>
> vc:typeAvailable, vc:typeUnavailable, vc:facetAvailable &
vc:facetUnavailable
>
> I think it would be nice if we implement these as well.
>
> I've some design ideas which I think might really work to implement
> these in Xerces-J.
>
> I think no body is working on an implemantation for these. I'm keen to
> work on this, and am starting on an implementation.
>
> I'll keep the list informed about the progress of this activity, and
> might post questions if any from my side.
>
> If anybody has any concerns please let us know.
>
> --
> Regards,
> Mukul Gandhi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Reply via email to