Return-Path: Delivered-To: apmail-xml-xerces-cvs-archive@www.apache.org Received: (qmail 48051 invoked from network); 17 Feb 2005 06:08:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 06:08:18 -0000 Received: (qmail 50016 invoked by uid 500); 17 Feb 2005 06:08:17 -0000 Delivered-To: apmail-xml-xerces-cvs-archive@xml.apache.org Received: (qmail 49986 invoked by uid 500); 17 Feb 2005 06:08:17 -0000 Mailing-List: contact xerces-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xerces-cvs@xml.apache.org Received: (qmail 49973 invoked by uid 99); 17 Feb 2005 06:08:17 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 16 Feb 2005 22:08:17 -0800 Received: (qmail 48039 invoked by uid 1678); 17 Feb 2005 06:08:16 -0000 Date: 17 Feb 2005 06:08:16 -0000 Message-ID: <20050217060816.48038.qmail@minotaur.apache.org> From: mrglavas@apache.org To: xml-xerces-cvs@apache.org Subject: cvs commit: xml-xerces/java/src/org/apache/xerces/xinclude MultipleScopeNamespaceSupport.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mrglavas 2005/02/16 22:08:16 Modified: java/src/org/apache/xerces/xinclude MultipleScopeNamespaceSupport.java Log: Fixing JIRA Bug #1044: http://issues.apache.org/jira/browse/XERCESJ-1044 Namespace lookup was incorrectly using the index into the context array rather than the member of that array, causing the processor to report that mappings don't exist when in fact they do exist. This bug is fixed thanks to the patch by Eric Isakson. There were three other methods where this was also a problem. I've fixed those as well. Revision Changes Path 1.8 +10 -10 xml-xerces/java/src/org/apache/xerces/xinclude/MultipleScopeNamespaceSupport.java Index: MultipleScopeNamespaceSupport.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xinclude/MultipleScopeNamespaceSupport.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- MultipleScopeNamespaceSupport.java 11 Jan 2005 13:40:29 -0000 1.7 +++ MultipleScopeNamespaceSupport.java 17 Feb 2005 06:08:16 -0000 1.8 @@ -23,7 +23,7 @@ /** * This implementation of NamespaceContext has the ability to maintain multiple - * scopes of namespace/prefix bindings. This is useful it situtions when it is + * scopes of namespace/prefix bindings. This is useful in situations when it is * not always appropriate for elements to inherit the namespace bindings of their * ancestors (such as included elements in XInclude). * @@ -90,9 +90,9 @@ public int getScopeForContext(int context) { int scope = fCurrentScope; - while (context < fScope[scope]) { - scope--; - } + while (context < fScope[scope]) { + scope--; + } return scope; } @@ -100,22 +100,22 @@ * @see org.apache.xerces.xni.NamespaceContext#getPrefix(java.lang.String) */ public String getPrefix(String uri) { - return getPrefix(uri, fNamespaceSize, fScope[fCurrentScope]); + return getPrefix(uri, fNamespaceSize, fContext[fScope[fCurrentScope]]); } /* (non-Javadoc) * @see org.apache.xerces.xni.NamespaceContext#getURI(java.lang.String) */ public String getURI(String prefix) { - return getURI(prefix, fNamespaceSize, fScope[fCurrentScope]); + return getURI(prefix, fNamespaceSize, fContext[fScope[fCurrentScope]]); } public String getPrefix(String uri, int context) { - return getPrefix(uri, fContext[context+1], fScope[getScopeForContext(context)]); + return getPrefix(uri, fContext[context+1], fContext[fScope[getScopeForContext(context)]]); } public String getURI(String prefix, int context) { - return getURI(prefix, fContext[context+1], fScope[getScopeForContext(context)]); + return getURI(prefix, fContext[context+1], fContext[fScope[getScopeForContext(context)]]); } public String getPrefix(String uri, int start, int end) { @@ -160,7 +160,7 @@ } /** - * Onlys resets the current scope -- all namespaces defined in lower scopes + * Only resets the current scope -- all namespaces defined in lower scopes * remain valid after a call to reset. */ public void reset() { --------------------------------------------------------------------- To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xerces-cvs-help@xml.apache.org