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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to