You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by jb...@apache.org on 2002/10/22 11:54:40 UTC

cvs commit: xml-xindice/java/src/org/apache/xindice/xml/sax SAXEventGenerator.java

jbates      2002/10/22 02:54:40

  Modified:    java/src/org/apache/xindice/xml/sax SAXEventGenerator.java
  Log:
  Fixed: 1) order of endElement / endPrefixMapping
         2) Correctly decoding UTF-8 of attribute values
  
  Revision  Changes    Path
  1.6       +9 -7      xml-xindice/java/src/org/apache/xindice/xml/sax/SAXEventGenerator.java
  
  Index: SAXEventGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/xml/sax/SAXEventGenerator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SAXEventGenerator.java	11 Mar 2002 12:46:51 -0000	1.5
  +++ SAXEventGenerator.java	22 Oct 2002 09:54:40 -0000	1.6
  @@ -222,8 +222,7 @@
               String attrURI = symbols.getNamespaceURI(symbol);
               String lclName = getLocalName(attrName);
   
  -	    /* UTF8TOFIX: must be fixed when switching to internal UTF-8 representation of strings */
  -	    String attrValue = new String(b);
  +	    String attrValue = new String(b, "UTF8");
   
   	    // look for and buffer newly mapped namespace prefixes
   	    if (attrName.startsWith(XMLNS_ATTR_PREFIX)) {
  @@ -323,11 +322,14 @@
   
         if ( element && !interrupt) {
   
  -	 // unmap any prefixes
  -	 for (int i = 0; i < nsMapCount; i++)
  -	     content.endPrefixMapping(mappedPrefixes[i]);
  +          // First, close element ...
  +          content.endElement(nsURI != null ? nsURI : "", localName, elemName);
   
  -         content.endElement(nsURI != null ? nsURI : "", localName, elemName);
  +          // ... and then any mapped NS prefixes
  +          for (int i = 0; i < nsMapCount; i++) {
  +
  +              content.endPrefixMapping(mappedPrefixes[i]);
  +          }
         }
   
         return !interrupt;