mrglavas    2004/04/13 10:30:02

  Modified:    java/src/org/apache/xml/serialize XMLSerializer.java
  Log:
  Fixing Bug #28064:

  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28064

  

  Attribute nodes were not being shown to the LSSerializerFilter when

  the namespaces parameter was set to false. Also, attributes defaulted

  from the DTD were not being discarded if discard-default-content was

  set to true.  This is now fixed thanks to the patch by Naela Nissar.
  
  Revision  Changes    Path
  1.60      +4 -19     xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- XMLSerializer.java        24 Feb 2004 23:34:03 -0000      1.59
  +++ XMLSerializer.java        13 Apr 2004 17:30:01 -0000      1.60
  @@ -692,7 +692,7 @@
               length = attrMap.getLength();
           }
   
  -        if (!fNamespaces) { // no namespace fixup should be perform                 
   
  +        if (!fNamespaces) { // no namespace fixup should be performed               
     
   
               // serialize element name
               _printer.printText( '<' );
  @@ -708,22 +708,7 @@
                   value = attr.getValue();
                   if ( value == null )
                       value = "";
  -                if ( attr.getSpecified()) {
  -                    _printer.printSpace();
  -                    _printer.printText( name );
  -                    _printer.printText( "=\"" );
  -                    printEscaped( value );
  -                    _printer.printText( '"' );
  -                }
  -                // If the attribute xml:space exists, determine whether
  -                // to preserve spaces in this and child nodes based on
  -                // its value.
  -                if ( name.equals( "xml:space" ) ) {
  -                    if ( value.equals( "preserve" ) )
  -                        fPreserveSpace = true;
  -                    else
  -                        fPreserveSpace = _format.getPreserveSpace();
  -                }
  +                printAttribute (name, value, attr.getSpecified(), attr);
               }
           } else { // do namespace fixup
   
  @@ -1128,7 +1113,7 @@
        */
       private void printAttribute (String name, String value, boolean isSpecified, 
Attr attr) throws IOException{
   
  -        if (isSpecified || (features & DOMSerializerImpl.DISCARDDEFAULT) != 0) {
  +        if (isSpecified || (features & DOMSerializerImpl.DISCARDDEFAULT) == 0) {
               if (fDOMFilter !=null && 
                   (fDOMFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE)!= 0) {
                   short code = fDOMFilter.acceptNode(attr);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to