cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/serialization AbstractTextSerializer.java
Date Wed, 19 Sep 2001 15:51:49 GMT
dims        01/09/19 08:51:49

  Modified:    src/org/apache/cocoon/serialization
                        AbstractTextSerializer.java
  Log:
  Patch from Joerg Henne <j.henne@levigo.de>
  for [Incorrect serialization to XML]
  
  Revision  Changes    Path
  1.6       +11 -9     xml-cocoon2/src/org/apache/cocoon/serialization/AbstractTextSerializer.java
  
  Index: AbstractTextSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/serialization/AbstractTextSerializer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractTextSerializer.java	2001/09/18 16:34:27	1.5
  +++ AbstractTextSerializer.java	2001/09/19 15:51:49	1.6
  @@ -35,7 +35,7 @@
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
  - * @version CVS $Revision: 1.5 $ $Date: 2001/09/18 16:34:27 $
  + * @version CVS $Revision: 1.6 $ $Date: 2001/09/19 15:51:49 $
    */
   public abstract class AbstractTextSerializer extends AbstractSerializer implements Configurable,
Cacheable, Poolable {
   
  @@ -188,8 +188,12 @@
           this.uriList.add(uri);
   
           // store mappings for xalan-bug-workaround.
  -        // append the prefix colon now, in order to save concatenations later.
  -        this.uriToPrefixMap.put(uri, prefix + ":");
  +        // append the prefix colon now, in order to save concatenations later, but
  +        // only for non-empty prefixes.
  +        if(prefix.length() > 0)
  +          this.uriToPrefixMap.put(uri, prefix + ":");
  +        else
  +          this.uriToPrefixMap.put(uri, prefix);
           this.prefixToUriMap.put(prefix, uri);
           
           super.startPrefixMapping(prefix, uri);
  @@ -222,9 +226,8 @@
         throws SAXException {
           
           // try to restore the qName. The map already contains the colon
  -        // FIXME (DIMS): This causes problems. This was a patch posted by Joerg
  -        //if(eltUri.length() != 0 && this.uriToPrefixMap.containsKey(eltUri) )
  -        //  eltQName = (String) this.uriToPrefixMap.get(eltUri) + eltLocalName;
  +        if(null != eltUri && eltUri.length() != 0 && this.uriToPrefixMap.containsKey(eltUri)
)
  +          eltQName = (String) this.uriToPrefixMap.get(eltUri) + eltLocalName;
           
           if (this.hasMappings) {
               // Add xmlns* attributes where needed
  @@ -294,9 +297,8 @@
       public void endElement(String eltUri, String eltLocalName, String eltQName)
       throws SAXException {
           // try to restore the qName. The map already contains the colon
  -        // FIXME (DIMS): This causes problems. This was a patch posted by Joerg
  -        //if(eltUri.length() != 0 && this.uriToPrefixMap.containsKey(eltUri) )
  -        //  eltQName = (String) this.uriToPrefixMap.get(eltUri) + eltLocalName;
  +        if(null != eltUri && eltUri.length() != 0 && this.uriToPrefixMap.containsKey(eltUri)
)
  +          eltQName = (String) this.uriToPrefixMap.get(eltUri) + eltLocalName;
           
           super.endElement(eltUri, eltLocalName, eltQName);
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message